Results 1 to 3 of 3

Thread: dynamic image

  1. #1
    Join Date
    Jan 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default dynamic image

    I have an image (see attachment) which I want to add hyperlinks in it, and the image's width is going to be dynamic width so that it can adjust automatically with the width of table (I'm using a table to hold this image, and I set the table's width to be dynamic - in this case 100%). Please let me know how to do it. Thank you kindly.

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

    Default

    You didn't attach any image but what you are looking for is really easy, just give the image 100% width:
    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>Titile</title>
            <style type="text/css">
                img {
                    width: 100%;
                }
            </style>
        </head>
        <body>
            <img src="http://www.ecto-web.org/~spookcentral/games_gb3_wp_logo1920w.jpg" alt="">
        </body>
    </html>
    I would also advise you not to use tables, take a look at this article:
    http://www.hotdesign.com/seybold/everything.html

    Good luck!

  3. #3
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Quote Originally Posted by uniemporium View Post
    I have an image (see attachment) which I want to add hyperlinks in it, and the image's width is going to be dynamic width so that it can adjust automatically with the width of table (I'm using a table to hold this image, and I set the table's width to be dynamic - in this case 100%). Please let me know how to do it. Thank you kindly.
    Are you asking how to add a link or how to make the image's width equal to the width of the table?

    Snookerman answered the latter. If you're asking the former, you would do something like this:

    Code:
    <a href="http://www.dynamicdrive.com"><img src="dd.jpg" alt="dynamic drive"></a>
    The width of the image is irrelevant to creating a link.

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
  •