Results 1 to 5 of 5

Thread: Link behind an Image

  1. #1
    Join Date
    Dec 2008
    Posts
    7
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Question Link behind an Image

    How can I prevent the "link a" and "a:hover" from showing up behind an image?

    Thank you.

    jjstccean.

  2. #2
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    2,023
    Thanks
    17
    Thanked 319 Times in 318 Posts
    Blog Entries
    3

    Default

    It depends what code you are using. You could use z-index or you could put the image in the background. If you want us to be able to help you:

    Please post a link to the page on your site that contains the problematic script so we can check it out.

  3. The Following User Says Thank You to Snookerman For This Useful Post:

    jjstccean (01-02-2009)

  4. #3
    Join Date
    Dec 2008
    Posts
    7
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    yep, I'm using <a Href="link">

    thank you

    jjstccean

  5. #4
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    2,023
    Thanks
    17
    Thanked 319 Times in 318 Posts
    Blog Entries
    3

    Default

    That was not much info to work with so I made an example page to show you two possible ways you can show a link on top of an image:
    HTML Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
            <title>Untitled Document</title>
            <style type="text/css">
                a {
                    font-size: 200%;
                }
                
                /*Example one with image as background*/
                div#example-one {
                    background: url(http://www.gamerflicks.com/images/uploads/ghostbusters_logo.gif) no-repeat;
                    height: 283px;
                    margin: 50px;
                }
                
                /*Example two with absolute positioning*/
                div#example-two {
                    position: relative;
                    margin: 50px;
                }
                
                div#example-two a {
                    position: absolute;
                    top: 0;
                    left: 0;
                }
            </style>
        </head>
        <body>
            <!--Example one with image as background-->
            <div id="example-one">
                <a href="http://www.google.com/">Google.com</a>
            </div>
            <!--Example two with absolute positioning-->
            <div id="example-two">
                <a href="http://www.dynamicdrive.com/">Dynamic Drive</a>
                <img src="http://www.cracked.com/blog/wp-content/uploads/2008/05/ghostbusters2.jpg" alt="Example two">
            </div>
        </body>
    </html>

  6. The Following User Says Thank You to Snookerman For This Useful Post:

    jjstccean (01-03-2009)

  7. #5
    Join Date
    Dec 2008
    Posts
    7
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    thank you kindly for the effort here. I've however sorted my problem with this very easy inline bit <img src="image.png" alt="image" border="0"> it's the border part that had me baffled. Now no link shows from behind the image.

    regards,

    jjstccean.

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
  •