Log in

View Full Version : dynamic image



uniemporium
01-07-2009, 05:34 AM
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.

Snookerman
01-07-2009, 10:22 AM
You didn't attach any image but what you are looking for is really easy, just give the image 100% width:

<!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 (http://www.hotdesign.com/seybold/everything.html)

Good luck!

Medyman
01-07-2009, 03:24 PM
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:


<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.