Setting Web page Margins

Setting Web page Margins

We can set web page margins to our site by specifying the following attributes in body tag.

<body topmargin=0 bottommargin=0 leftmargin=0 rightmargin=0 marginheight=0 marginwidth=0>
We can change or remove the attributes according to our site. We can use this both in Internet Explorer and Netscape Navigator.

Internet Explorer supports:

topmargin=0
bottommargin=0
leftmargin=0
rightmargin=0

Netscape Navigator supports:

marginheight=0
marginwidth=0

We should be careful while using this margin settings, because it should not affect our site in various browsers. Following is an example with the margin attributes.

<body topmargin=5 bottommargin=5 leftmargin=10 rightmargin=10 marginheight=0 marginwidth=0>

Leave a Reply

You must be logged in to post a comment.


All material @ copyrighted by chrisranjana.com. If you want to link to this article you are welcome to do so. Unauthorized publication is strictly prohibited. This developer tutorial website contains articles by Php programmers , Software developers, Mysql programmers and asp c# programmers. This website also contains ajax tutorials and advanced mysql sql stored procedures and functions tutorials and sample codes.