Basic query

B

Brian Tozer

In the following situation why would there be a narrow band of the
background colour appearing above the graphic, and a wider/thicker/taller
band appearing below it.
I know how to handle the situation with CSS but would like to know why this
situation exists.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title></title>
</head>

<body>
<table width="100%">
<tr>
<td bgcolor="red">
<img src="foo.gif">
</td>
</tr>
</table>
</body>
</html>

Thanks
Brian Tozer
 
H

Hywel Jenkins

In the following situation why would there be a narrow band of the
background colour appearing above the graphic, and a wider/thicker/taller
band appearing below it.
I know how to handle the situation with CSS but would like to know why this
situation exists.

<td bgcolor="red">
<img src="foo.gif">
</td>

There's whitespace. Try this:
<td bgcolor="red"><img src="foo.gif"></td>
 
B

Brian Tozer

(e-mail address removed) says...
There's whitespace. Try this:
<td bgcolor="red"><img src="foo.gif"></td>

Aha! Many thanks.
I now have what looks like a few pixel width of border of the background
colour showing above and below the graphic, which I have been unable to
eliminate.
I have implemented what must be overkill to try and eliminate this border.
To no avail.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title></title>
<style type="text/css">
<!--
body {
margin: 0px;
padding: 0px;
}

..noborder {
border: 0px;
margin: 0px;
padding: 0px;
}

..table1 {
width: 500px;
background-color: red;
border: 0px;
padding: 0px;
margin: 0px;
}

-->
</style>
</head>

<body>
<table class="table1">
<tr>
<td class="noborder"><div class="noborder"><img class="noborder"
src="foo.gif" width="410" height="54"></div></td>
</tr>
</table>
</body>
</html>

Thanks
Brian Tozer
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top