It helps a lot. Thank you! I'd be interested in hearing other techniques
out there, so please chime in if you like.

Spell

-----Original Message-----
From: James Leslie [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 07, 2007 12:43 PM
To: Spellacy, Michael
Cc: css-d@lists.css-discuss.org
Subject: RE: [css-d] Margin & Padding: Best Practices


I was just wondering what the best practice is for handling default
user-agent margin and padding? For more control over my layout I suppose
I could set a universal selector to eliminate the default stuff (*
{margin: 0; padding: 0;))and then override it where I need to further on
in the document, but killing those property values seems instinctively
wrong to me. I'm worried about eliminating it in places where it could
be useful by default (like on block-level elements such as p, ul, ol,
etc.). Should I resort to such trickery, or should I be setting margin
and padding to zero on all individual rules that do not need a specific
margin or padding value? 

-------

I don't think there is a 'right' answer here, more down to personal
choice. I tend to use the following at the start of a css doc:

body, h1, h2, h3, h4, h5, h6, p, blockquote, ul, ol, li, table, tr, th,
td, form { margin 0; padding 0; border 0; list-style none; font-size
100%; font-weight normal; } img{
border:0:
}

This deals with all the elements that you want to get rid of
margins/padding/etc on without adversely effecting form elements in the
way that the universal selector does. Then I add margins to the elements
that need them as I use them.

It works for me anyway, but I am sure others will do things differently,
hope that helps,

James
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7 information -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to