Click to See Complete Forum and Search --> : HTML Help
DSilpa
12-21-2002, 04:27 AM
Hello - I am an HTML beginner and need help with something I hope is simple. In the attached file, you can see that there is a big space between the graphic on top (portrait page3.gif) and the start of the top of the table containing images below it. I can't seem to get rid of this space no matter what I try. The space is not there when I view the page in Dreamweaver but when I view it in Explorer, it is there. Can anyone help?
Thanks.
Stefan
12-21-2002, 07:00 AM
In the attached file, you can see that there is a big space between the graphic on top (portrait page3.gif) and the start of the top of the table containing images below it.
Since you do not link to the images there is obviously no way for us to see this. An URL to the page would have been much better.
Though I can already now tell that you are missing important parts on your webpage that will make it not pass validation, eg the DOCTYPE
Start with adding eg this at the very top of your webpage (before <html>)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
or if you are trying to make your page work with NS 3 or even older browsers
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
and then check your page at
http://validator.w3.org
DSilpa
12-21-2002, 04:11 PM
Stefan -
Here is the URL to my site:
www.davidsilpa.com
Can you see something obvious that would cause the big space I described?
I will try the validator that you suggested but I'm afraid what it will find!! :)
Thanks for your post.
Stefan
12-22-2002, 12:03 AM
Try this
<!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">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta http-equiv="Content-Style-Type" content="text/css">
<title>David's Photo Site</title>
<style title="Default" media="screen" type="text/css">
body {background:url(images/yellow_stucco.gif); color:blue; font:100% arial, verdana, courier, sans-serif; text-align:center;}
h1 {font-size:110%;}
table {margin:0 auto;}
</style>
</head>
<body>
<h1>David's Main Photo Page</h1>
<hr>
<p>Click the images to see that<br>collection of photos</p>
<table>
<tr>
<td align="center"> <a href="morocco.htm"><img alt="" src="images/camel.jpg" width="150"></a><br><i>Morocco</i></td>
<td align="center"> <a href="paris.htm"><img alt="" src="images/eiffel tower closeup.jpg" width="150"></a><br><i>Paris</i></td>
<td align="center"> <a href="children.htm"><img alt="" src="images/child with cotton candy.jpg" width="150"></a><br><i>Children</i></td>
<td align="center"> <a href="portraits.htm"><img alt="" src="images/hadas sexy.jpg" width="150"></a><br><i>Portraits</i></td>
<td align="center"> <a href="lovers.htm"><img alt="" src="images/lovers in luxembourg1.jpg" width="150"></a><br><i>Lovers</i></td>
</tr>
<tr>
<td align="center"> <a href="color.htm"><img alt="" src="images/kids festival.jpg" width="150"></a><br><i>Color</i></td>
<td align="center"> <a href="corsica.htm"><img alt="" src="images/the gorgeous gorge.jpg" width="150"></a><br><i>Corsica</i></td>
</tr>
</table>
<p><a href="mailto:silpasan@yahoo.com">silpasan@yahoo.com </a></p>
<p>David Silpa<sup>©</sup></p>
</body>
</html>
BTW, you should specify an alt-text that describes the images for when people cannot see them (for technical or disability reasons).
Paul O'B
12-22-2002, 06:43 AM
Hi Dsilpa,
I know you probably won't need this now that Stefan has given you some nice code to do the job properly, but the reason you had a space between your text and the top of the table was because you have 2 line breaks in the wrong place i.e. in the middle of your table rows.
<tr>
</tr>
<br><br>
<tr>
</tr>
The breaks will have no effect upon the table unless they are in between the correct td tags, but they have affected the space around the table.
Paul
DSilpa
12-22-2002, 01:35 PM
Stephan & Paul -
Thank you both for your reply. It was a big help.
David