Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 6 of 6
  1. #1
    Junior Member
    Join Date
    Oct 2010
    Posts
    5
    Member #
    24486
    How do I hyperlink an image through a CSS code? I'm only familiar with doing it via HTML. Is it even possible?
    Thank you.

  2.  

  3. #2
    WDF Staff AlphaMare's Avatar
    Join Date
    Oct 2009
    Location
    Montreal, Canada
    Posts
    4,570
    Member #
    20277
    Liked
    878 times
    Can you be a bit more clear about what it is your are asking?

    Do you want to set an image in CSS to show on a page, but it is on another site or in another folder?

    Or do you want to create a link on the page where the image shows?
    Good design should never say "Look at me!"
    It should say "Look at this." ~ David Craib


    http://digitalinsite.ca ~ my current site . . info@digitalinsite.ca ~ my email

    If you feel that someone's post helped you fix your problem, answered your question, or just made you feel better, feel free to "Like" their post. The "Like" link is at the bottom right of each post, along side the "reply" link. And if you are being helped here, try to help someone else - pass it on!

  4. #3
    Junior Member andrewreff's Avatar
    Join Date
    Sep 2010
    Location
    Indianapolis
    Posts
    20
    Member #
    23933
    You can not physically hyperlink an image through css so that it takes you to another page or site upon clicking it. You can ultimately change the linked source that an image displays through css (even though it's not a good practice) by leaving the html image src blank and displaying your actual image in the css

  5. #4
    Junior Member
    Join Date
    Oct 2010
    Posts
    5
    Member #
    24486
    Thank you both. Yes, I want to show the image, but have it displayed thru CSS. I ultimately solved this by putting it on the HTML page instead, not what I set out to do, but since learned that it can't be linked thru CSS.

  6. #5
    Banned
    Join Date
    Oct 2010
    Posts
    11
    Member #
    24426
    You can use this code

    HTML Code:
    <a id="logo" href="/"><span>Logo Text</span></a>


    Then...

    Code:
    #logo { display: block; /* Or float left, whichever is necessary... */ width: SOMEpx; height: SOMEpx; background-image: url(/path/to/image.gif); } #logo span { /* Hide the "Logo Text" from view... */ display: block; width: 0; height: 0; overflow: hidden; }

    Pro: Better for SEO than an alt attribute, I believe, and perfectly accessible.
    Con: Difficult to make it print.

    Otherwise, it's just:
    HTML Code:


    <a href="/"><img src="/path/to/image.gif" alt="Logo Text" /></a>

  7. #6
    Junior Member
    Join Date
    Oct 2010
    Posts
    5
    Member #
    24486
    Thanks for your help!


Remove Ads

Posting Permissions

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

Search tags for this page

adding hyperlink link to image in css

,

click image to hyperling css

,

css image with hyperlink

,

hyperlink image css

,

image hyberlink in css

Click on a term to search for related topics.
All times are GMT -6. The time now is 02:58 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com