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,421
    Thanks
    697
    Thanked 293 Times in 221 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
    Current Celebrity Gossip Movies & More TV Site
    Find out how I'm able to get up to 420 backlinks for month, by spending 30 seconds per day...all for FREE! - Click Here

  2. #2
    Andy101's Avatar
    Andy101 is online now Code Otaku
    Join Date
    Aug 2009
    Location
    Kanazawa
    Posts
    1,313
    Thanks
    178
    Thanked 309 Times in 236 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>
    Otaku CMS - Import a WordPress blog and manage your site using single-page App technology

  3. Thanked by:

    Sami4u (25 December, 2010)

  4. #3
    TopDogger's Avatar
    TopDogger is offline Über Hund
    Join Date
    Jan 2009
    Location
    Hellfire, AZ
    Posts
    3,106
    Thanks
    350
    Thanked 919 Times in 703 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.
    "Democracy is two wolves and a lamb voting on what to have for lunch. Liberty is a well-armed lamb contesting the vote." -- Benjamin Franklin


  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,421
    Thanks
    697
    Thanked 293 Times in 221 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
    Current Celebrity Gossip Movies & More TV Site
    Find out how I'm able to get up to 420 backlinks for month, by spending 30 seconds per day...all for FREE! - Click Here

  7. #5
    Mike-XS's Avatar
    Mike-XS is offline XeroAgent
    Join Date
    Sep 2009
    Location
    OZ
    Posts
    209
    Thanks
    30
    Thanked 109 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, 03:15 AM
  2. What made you get your own forum ?
    By StephenM in forum Community Building
    Replies: 19
    Last Post: 13 July, 2010, 04:41 AM
  3. a few things i made
    By Dragoth in forum General Chat
    Replies: 7
    Last Post: 14 April, 2010, 21:48 PM
  4. My Blog Made it Big
    By Jamivibes in forum Blogging
    Replies: 2
    Last Post: 21 August, 2009, 15: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, 11: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
  •