Forum Moderators: not2easy

Message Too Old, No Replies

2 Questions: Spacing between Elements and default values.

         

Laibcoms

8:19 am on Aug 23, 2007 (gmt 0)

10+ Year Member



2 Questions:

1) What is the default margin and padding value of all elements (follow-up: px or em?)?
2) When creating spaces between elements, which is better to use - margin or padding or both?

My first few lines of my style sheet.


body {
margin: 0 auto;
padding: 0;
height: 100%;
font-family: Candara, Corbel, Calibri, Verdana, Arial, Helvetica, Tahoma, sans-serif;
/* font-size: 63.8%; */
}

* {
margin: 0;
padding: 0;
border: 0;
}

Thanks!

Marshall

8:32 am on Aug 23, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Default will vary with browsers, hence that is why it is good to assign margins individually.

As for spacing elements by margin or padding: margin is outside the element, padding is inside, and both should be added to the overall width and height of the element, as with adding border thickness.

Marshall