Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding margin at bottom of page

Status
Not open for further replies.

TheInsider

Programmer
Jul 17, 2000
796
CA
Hello,

I have an html page in which I set the
Code:
<BODY>
tag to:
Code:
<BODY TOPMARGIN=&quot;10&quot;>
In Internet Explorer 6 this gives me a page with a 10 pixel margin at the top AND bottom. In Netscape 7 this only gives me a 10 pixel margin at the top, but nothing at the bottom.

I like the behavior of Internet Explorer 6, but can't get Netscape 7 to replicate it.
Code:
BOTTOMMARGIN
is not recognised in Netscape either.

I have tried using style sheets to set the margin bottom to 10 pixels:
Code:
BODY {
MARGIN-BOTTOM:10px;
PADDING-BOTTOM:10px;
BORDER-BOTTOM:10px SOLID WHITE;
}
however, none of these work.

If it matters, I have a couple
Code:
<P></P>
tags enclosed in a pair of
Code:
<DIV></DIV>
tags, like:
Code:
<HTML>
<HEAD>
</HEAD>
<BODY TOPMARGIN=&quot;10&quot;>
<DIV STYLE=&quot;HEIGHT:100%&quot;>
<P>hello world line 1</P>
<P>hello world line 2</P>
</DIV>
</BODY>
</HTML>
How can I get IE6 and NS7 to both display top and bottom margins of 10 pixels in the
Code:
BODY
?
 
How about just put a transparent GIF image, with 10 pixel height, to top and bottom of the page, which should give you the same top and bottom effect, and works in all browsers.
 
thanks byam, that is a good workaround, however I just realised that it is the
Code:
STYLE=&quot;HEIGHT:100%&quot;
in the
Code:
DIV
tag that is causing Netscape to remove the bottom border.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top