...

View Full Version : Making image 100% of frame?



axcxe
02-03-2004, 09:43 PM
It has been a while since I wrote any html. Im not sure why but I can't get my menu image to take up 100% of my left frame in my html document. There is a black border around it that is permanent. If you resize the ie window the image resizes with the black border. My code is:

<img src="menu2.gif" width="100%" height="100% "border="0" hspace="0" vspace="0">

Does this have something to do with Dreameweaver? any help is appreciated

ronaldb66
02-04-2004, 10:23 AM
Without seeing the rest of the code, I can't really put a finger on it; what I can say straight away is that having the browser resize an image will often yield... erm, unexpected results. Reducing the size should be ok, unless it's by a small amount, but enlarging will quickly deteriorate image quality.

axcxe
02-04-2004, 09:53 PM
The code for my frameset:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<title>Mobile Tranquility</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<frameset rows="*" cols="170,470" framespacing="0" frameborder="1" border="0">
<frame src="topFrame2.htm" name="topFrame" scrolling="NO" noresize >
<frame src="mainFrame.htm" name="mainFrame" scrolling="auto" noresize>
</frameset>
<noframes><body>

</body></noframes>
</html>

and my topFrame (where the image is located ):


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Mobile Tranquility</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="tranq.css">
</head>
<body bgcolor="#000000">
<img src="menunew.gif" width="100%" height="100%" vspace="0" hspace="0">
</body>
</html>

Thanks for the reply

ronaldb66
02-06-2004, 10:40 AM
<body bgcolor="#000000">
You've made your body background color black (!), and body by default gets a margin of a couple of pixels, so the black border you see actually is the black background showing through.

It's advised to use CSS for presentation aspects anyway, so ditch the bgcolor attribute and define a style, either included or in a seperate style sheet (preferred):

body {background-color: #000;
margin: 0;
}

axcxe
02-06-2004, 07:48 PM
Thank you for your help. I was planning on using css for the bgcolor in the end, but I was being lazy while trying to figure out my menu. I didn't realize that body got a default margain. Thanks again



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum