Click to See Complete Forum and Search --> : background
tiger66
06-09-2003, 10:08 PM
Hello
I am trying to set an image as the background of my header
In CSS file I have
td.header
{
background-image:url("header.gif")
}
In HTML file I have
<td class="header"></td>
However, it doesn't show me anything
where did I do wrong?
Thanks
Charles
06-10-2003, 04:54 AM
Originally posted by tiger66
where did I do wrong? 1) You are mis-using HTML. Headers need to be marked up as such.
2) Empty elements tend to be of 0 size.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Content-Script-Type" content="text/javascript">
<title>Example</title>
<style type="text/css">
<!--
.header {background-image:url(http://icons.wunderground.com/graphics/conds/partlycloudy.GIF)}
-->
</style>
<h1 class="header"> </h1>
<table summary="">
<tr><th class="header">Partly Cloudy</th><td> </td></tr>
</table>
tiger66
06-10-2003, 07:42 PM
Hello Charles
I tried your code, it doesn't show the image either
Does background only works for <body> tag?
Charles
06-10-2003, 07:58 PM
Sorry about that, I had some board issuse. Cut and paste the following:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Content-Script-Type" content="text/javascript">
<title>Example</title>
<style type="text/css">
<!--
.header {background-image:url(http://www.bettiepage.com/images/photos/whip/whip7_a.jpg)}
-->
</style>
<h1 class="header">&nbsp;</h1>
<table summary="">
<tr><th class="header">Partly Cloudy</th><td> </td></tr>
</table>