Forum Moderators: open
I have searched the forum and found this:
style="margin-top:0;padding-top:0;"
But that does not work. It moves it up when I put it into dreamweaver (in the edit mode), but the browser still shows the gap after a refresh...both IE and FF browsers show the gap.
Can someone help,
Thanks,
Steve
<body background="background1.gif" link="#006600"style="margin-top:0;padding-top:0;">
It moves it right up in the dreamweaver view when I add it. However, in a browser it starts at the top for an instant, then moves down about 3/8 of an inch.
I have zero padding for the table and nothing else special about the page. Not sure if I can post the URL here...it is a sales page.
I appreciate your help,
Steve
I gave the table a border and that is in fact right where it ends.
I validated the html and nothing came up which I thought was serious...some missing alt tags etc.
Steve
Depending on your doctype, some browsers may not support these tags:
<body background="background1.gif" link="#006600"style="margin-top:0;padding-top:0;">.
Try:
<head>
<style type="text/css">
body {
background-image: url(background1.gif); /* adjust url to exact file path */
margin-top: 0px;
padding-top: 0px;
}
a {
color: #060;
}
</style>
</head>
Marshall
I'll post the code to the top of the page here if someone has another suggestion. (There is no other CSS or other scripting on the page.)Otherwise I'll give up on it for a while I guess.
Thanks everyone!
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title></head>
<head>
<style type="text/css">
body {
background-image: url(background1.gif); /* adjust url to exact file path */
margin-top: 0px;
padding-top: 0px;
}
a {
color: #060;
}
</style>
</head>
<table width="724" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
head sections - the error-handling in the browser will take the second as on-page space. <title></title>[b]</head>
<head>[/b] Try:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
<style type="text/css">
body {
background-image: url(background1.gif); /* adjust url to exact file path */
margin-top: 0px;
padding-top: 0px;
}
a {
color: #060;
}
</style>
</head>
<table width="724" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> The HTML validator [validator.w3.org] is your friend. ;)
Error Line 20 column 7: start tag for "TR" omitted, but its declaration does not permit this.
<td><img src="backporchbanner.jpg" width="728" height="90"></td>
However, I did discover something. If I take the image out of the table, it WILL go all the way to the top by itself. (But there is then a big gap between the image and the table.) If I get rid of the image, the table won't go to the top. So I think it is something with the table. (pad and space are set to 0)
Steve
This works for me;
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head><title></title></head>
<head>
<style type="text/css">
body {
background-image: url(background1.gif); /* adjust url to exact file path */
margin-top: 0px;
padding-top: 0px;
}
a {
color: #060;
}
</style>
</head>
<body>
<table width="724" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td>sdfg</td>
</tr>
</table>
</body>
</html>
You might also want to try adding this in the head tag between the CSS tags:* {
margin: 0;
padding: 0;
}
Only if you want to give yourself a mild heart attack! ;) This will set the margin and padding to 0 on all elements. The idea being that it will give a common ground on which to build your styles across all browsers - since different browsers have different default settings for margin / padding.
This could be a good thing if you are building a new site, but if you already have a functioning site - then you'd have to redo your entire stylesheet! This is of course assuming you have built your site around CSS in the first place.
Trace:
I don't see the body tag in your code snippet.
This works for me...
Yeah, I wondered that, but the BODY element is optional (W3C [w3.org]) and it does work OK without it.
Just to note, you've got the two <head> sections back in! ;) (See encyclo's post [webmasterworld.com] above)