Results 1 to 5 of 5

Thread: Can CSS code be made clickable?

  1. #1
    Sami4u's Avatar
    Sami4u is offline Butterflies Forever
    Join Date
    Sep 2009
    Location
    USA
    Posts
    1,200
    Thanks
    520
    Thanked 277 Times in 209 Posts

    Can CSS code be made clickable?

    Hi,

    The title says it all. Can a css code be made into a clickable link?

    If so what is the code for that please.

    I think I have tried every link code I know none seem to be working

    Thanks in advance.

    Sami
    Check out the Current Celebrity Gossip
    Bored??? TV Shows, Movies & More TV Site
    Las Vegas Resorts ~~~ Sexiest Halloween Costumes Ever

  2. #2
    Andy101's Avatar
    Andy101 is offline Code Otaku
    Join Date
    Aug 2009
    Location
    Japan/uk
    Posts
    699
    Thanks
    100
    Thanked 217 Times in 161 Posts
    CSS code is only for styling the appearance of web page elements such as for the color or margins etc.

    You have to use Javascript to make web page elements clickable.

    Basically you insert an attribute into the element such as the onClick event handler. It's best to read up on this at places such as Tizag.com or W3Schools.com

    Code:
    <div onclick="location.href('http://mysite.com')">Click Here</div>
    Article authors check out: Resource Box Wizard

  3. Thanked by:

    Sami4u (25 December, 2010)

  4. #3
    TopDogger's Avatar
    TopDogger is offline Über Hund
    Join Date
    Jan 2009
    Posts
    1,343
    Thanks
    201
    Thanked 575 Times in 403 Posts
    Sami, you must be referring to a link that is styled using CSS. You can do mouseover changes to an HTML or JavaScript link wth CSS, but CSS has no ability to provide a clickable link.
    You can have it fast, good or cheap. Pick any two.

  5. Thanked by:

    Sami4u (25 December, 2010)

  6. #4
    Sami4u's Avatar
    Sami4u is offline Butterflies Forever
    Join Date
    Sep 2009
    Location
    USA
    Posts
    1,200
    Thanks
    520
    Thanked 277 Times in 209 Posts
    Hi,

    OK well never hurts to try I have a plugin that needs work, I was hoping I could get to it this way

    Looks like another project for a coder if I ever find one the wants to work.

    Sami
    Check out the Current Celebrity Gossip
    Bored??? TV Shows, Movies & More TV Site
    Las Vegas Resorts ~~~ Sexiest Halloween Costumes Ever

  7. #5
    Mike-XS's Avatar
    Mike-XS is offline XeroAgent
    Join Date
    Sep 2009
    Location
    OZ
    Posts
    206
    Thanks
    30
    Thanked 108 Times in 71 Posts
    If we are talking about images, then usually background images which are set in an external .css file for example can't be used for links, but there are ways to get around that.

    Some examples:

    CSS Trick: Turning a background image into a clickable link - Xavisys
    Tutorial 1 - Clickable Background Image in CSS
    Creating clickable background images using CSS - Joomla! Documentation

  8. Thanked by:

    Sami4u (18 February, 2011)

Similar Threads

  1. What Do You Do With The Money You Made ?
    By StephenM in forum Business
    Replies: 24
    Last Post: 9 November, 2010, 02:15 AM
  2. What made you get your own forum ?
    By StephenM in forum Community Building
    Replies: 19
    Last Post: 13 July, 2010, 03:41 AM
  3. a few things i made
    By Dragoth in forum General Chat
    Replies: 7
    Last Post: 14 April, 2010, 20:48 PM
  4. My Blog Made it Big
    By Jamivibes in forum Blogging
    Replies: 2
    Last Post: 21 August, 2009, 14:17 PM
  5. How much money did you made this day?
    By console_predator in forum General Chat
    Replies: 20
    Last Post: 3 August, 2009, 10:55 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •