Web Analytics Made Easy -
StatCounter Text over image over image link - CodingForum

Announcement

Collapse
No announcement yet.

Text over image over image link

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Text over image over image link

    Hello,
    I am basically trying to do the following thing:
    I have a bigger image, smaller one and a text link.
    The aim is to put the small image over the big one and the text on top.
    And the whole thing should be a link.
    Basically it is a product image with a price tag text and some background image for the price tag - the whole thing links to the specific product page.
    Oh, yeah - and it should work in IE6 and 7

    Code:
    <div class="box">
    <a href="http://google.com">
    	<span class="text" style="margin-top:-50px;margin-right:-50px;z-index:100;">Test text over small image over big image</span>
    	<img alt="Small image over" src="smallImage.jpg" style="margin-top:-50px;margin-right:-50px;z-index:100;">
    	<img alt="Big image under" src="bigImage.jpg" style="z-index:1;"></a>
    
    </div>
    Any help is greatly appreciated.

  • #2
    Hi there rkmv,

    and a warm welcome to these forums.

    Can you provide us with links to the images in question?

    We would then be able to supply you with the appropriate code.

    coothead
    ~ the original bald headed old fart ~

    Comment


    • #3
      How about using big image as the <a> element background?
      u can then display:block the <a> element and give it the same heigth and with as the big image.

      Comment


      • #4
        Tried using the image as an <a> element background, but it is not really doing the job - I'll give it another go to see if I can figure it out.

        coothead - there are the images:
        http://img714.imageshack.us/img714/5850/bigimagec.jpg
        http://img18.imageshack.us/img18/7221/smallimage.png

        Thank you.

        Comment


        • #5
          Hi there rkmv,

          here is the basic code for you to play with...
          Code:
          
          <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
             "http://www.w3.org/TR/html4/strict.dtd">
          <html lang="en">
          <head>
          
          <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
          <meta name="language" content="english"> 
          <meta http-equiv="Content-Style-Type" content="text/css">
          
          <title>dessert link</title>
          
          <style type="text/css">
          #box {
              width:500px;
              border:3px double #666;
              margin:auto;
           }
          #box a {
              display:block;
              height:325px;
              padding-top:50px;
              background-image:url(http://img714.imageshack.us/img714/5850/bigimagec.jpg);
              color:#000;
              text-decoration:none;
           }
          #box span {
              float:right;
              width:129px;
              height:35px;
              line-height:35px;
              margin-right:50px;
              background-image:url(http://img18.imageshack.us/img18/7221/smallimage.png);
              text-align:center;
           }
          </style>
          
          </head>
          <body>
          
          <div id="box">
           <a href="http://www.google.com">
            <span>google</span>
           </a>
          </div>
          
          </body>
          </html>
          
          coothead
          ~ the original bald headed old fart ~

          Comment

          Working...
          X