Articles Tutorials Work at Home Entrepreneurs, Webmasters, Small Business Owners
Articles Tutorials Work at Home Entrepreneurs, Webmasters, Small Business Owners
Articles & Tutorials for Work at Home Entrepreneurs
Webmasters and Small Business Owners
Get More >

Newest Articles 
Search Engine Marketing
Internet Marketing
Affiliate Marketing
Email Marketing
Viral Marketing
Webmaster Resources
Business Resources
Make More Money
CSS
Web Design
Graphic Design
Color Theory
Product Reviews
Time Management
Business Ethics
Promotional Strategies
Glossary of Terms
Direct Mail Marketing
Telemarketing
Product Sourcing



Link to Us!

CSS
Email this article  :  Printer friendly page

Controlling Page Margins with External CSS

What are page margins and why would you want to use them? You have seen them before but may have not realized it. Some web pages have a margin (space around the edges of the browser window). Web pages that do not have a page margin, will display the page content and graphics flush with the browser window. Each method has a purpose and creates a different effect. Try using different page margin values with your web site and see which you prefer.

The HTML code for page margins is shown below, BUT if you want to make your page margin changes in just one file so you can change it site wide rather than on each individual HTML page, did you know that you can do this using external CSS?

HTML method (add code the BODY tag of your web page source code):

<BODY LEFTMARGIN="10" TOPMARGIN="10" MARGINWIDTH="10" MARGINHEIGHT="10">

CSS method (add code to the BODY tag of your external style sheet):

body {margin-top: 10px;
margin-right: 10px;
margin-bottom: 10px;
margin-left: 10px;}

To reduce your margins to zero (all page content is displayed flush with the browser window) simply change the values to zero or zero pixels.

In the example code above, all page margins are set to 10.

Copyright © 1994-2006 by BasicTips.com, a division of BasicTemplates.com, CSS HTML Web Site Templates with Exernal CSS and Removable Graphics. If you found our articles helpful, subscribe to our newsletter and get articles like this delivered to your inbox - FREE.

Order soon and get up to 5 FREE domains & more!
Host 6 Domains on 1 Account
5000MB and 400GB for $6.95 a month!

 

Page copy protected against web site content infringement by Copyscape
All articles are originally authored by BasicTemplates.com. Reprints in whole or in part are not permitted. See Copyright Notice

Copyright © 1994-2006 BasicTips.com, a division of BasicTemplates.com, Web Site Templates with External CSS
The Internet's #1 Choice for HTML CSS Web Templates via a Membership. Designed using External CSS and Removable, Swap-Out Graphics.
Basic Web Templates | Website Templates | HTML CSS Templates | Web Design Templates | Web Site Templates