margins

  • Thread starter Thread starter Sandra Hendsbee
  • Start date Start date
S

Sandra Hendsbee

Hi:

I'm tring to set all margins to 0 on my website. What code can I use to
accomplish this?

Thanks,
Sandra
 
Link to an external stylesheet, or embed a stylesheet in your code (between
<head> and </head>) with the following style in it (embedded shown for
cut-n-paste convenience) (assuming you want zero margins) -

<style type="text/css">
<!--
body { margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left:
0px; padding:0px; }
-->
</style>

you could also try

body { margin : 0px 0px 0px 0px; padding:0px; }

or

body { margin : 0px; padding:0px; }

as a shorthand method.

This will take care of the margins in IE4+ and NN6. To take care of NN4x,
you will need to modify the body Properties... and set the two margin fields
(marginwidth and marginheight) to 0.

Since you are still using inline margin specs in the body tag, this method
won't validate. To get completely valid code that works for all
browsers, change your stylesheet as shown below -

body {
padding: 0;
margin: 0 -10px 0 -10px; /* this takes care of NN4x */
/*/*/margin: 0 0 0 0; /* */
/* the previous line takes care of all the rest of them /*
}
 
Hi:

Thanks for getting back to me.
It doesn't work. It seems to happen when I spliit a cell and insert a
table.

Sandra
 
It works on the PAGE but it won't affect margins within a container on the
page. Show me your code please and tell me where you are trying to set the
margins, and what margins you are trying to set.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top