Forum Moderators: not2easy

Message Too Old, No Replies

Body topmargin and marginheight

Do I need to emulate these in CSS?

         

IanTurner

11:34 pm on Dec 5, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



When laying out a page using CSS do I need to use a style to display marginheight and topmargin attibutes?

seindal

11:47 pm on Dec 5, 2002 (gmt 0)

10+ Year Member



You can still have the marginheight and topmargin attributes to the body tag, but you can also use a

BODY { margin-top: 100px; }

in a stylesheet.

René.

Nick_W

7:27 am on Dec 6, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, if you're looking to eliminate margins your rule might look like this:

body {
margin: 0; /* sets all to 0 */
padding: 0; /* think Opera sets padding on body */
}

Or if you need different margins/padding on different sides use the shorthand like this:

body {
margin: 0 10px 0 20px; /* top, right, bottom, left */
}

Nick