PDA

View Full Version : Image not displaying


nick2price
01-10-2009, 10:31 PM
I have images in a folder. I am trying somthing new so the layouts of my page when opened in a browser is better. So i have done the code like so
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>London 2012</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><style type="text/css">
<!--
body {
background-image: url(images/olympics2.jpg);
background-repeat: no-repeat;
}
-->
</style></head>
<body bgcolor="#FFFFFF">
</table>
<table width="816" height="618">
<td width="800" height="593" >
<table width="186" height="149" border="0">
<tr>
<th width="180" height="52" scope="row"><input type="submit" name="Submit2" value=" ENTER DATA " onClick="location.href='/cmt3082/AddCompetitor.jsp';"></th>
</tr>
<tr>
<th height="53" scope="row"><input type="submit" name="Submit2" value=" PRINT RESULTS " onClick="location.href='/cmt3082/PrintResults.jsp';"></th>
</tr>
<tr>
<th height="36" scope="row"><input type="submit" name="Submit2" value=" SEARCH " onClick="location.href='/cmt3082/SearchResults.jsp';"></th>
</tr>
</table>

</form>

</table>
</body>
</html>


The problem lies with the image in
body {
background-image: url(images/olympics2.jpg);
background-repeat: no-repeat;
}

It shows the image in dreamweavers design view, but when opened in a browser, no image displays. Is there a problem with what i have done?
thanks

domedia
01-10-2009, 10:49 PM
This is not a valid page. You cannot start the page by ending a table that has never opened. The page structure is broken, and I don't blame the browser for not knowing what to do with it. Try this:

remove the ending TABLE tag that appears after the BODY tag starts.
Make Sure there is a TR before your first TD.
then you have a closing FORM tag for a form that does not exist, remove it.
Then you're closing a second TABLE without having closed a TD and a TR first.

If you use any kind of validator, or just remake the page, you should be good as well.