Jump to content


stripping default margin/padding from all elements in CSS

  • Please log in to reply
1 reply to this topic

#1 akitchin

  • Staff Alumni
  • Advanced Member
  • 2,516 posts
  • LocationCalgary, AB, Canada

Posted 18 July 2006 - 03:46 AM

i recently saw a post that advocated using * { margin: 0; padding: 0; } to avoid most typical CSS alignment issues.  i quite liked this, because it did resolve a lot of cross-browser problems.  when i used a <select></select> box in firefox with this declaration in the stylesheet, its width was inexplicably shorter than the longest (and indeed, most) options.  no amount of padding/margin changes to the select element (type selected and with the style attribute) would fix it.  two questions:

1.  does anyone else get this happening to them?
2.  anyone know of a fix?

for now i've simply specified all tags other than select that i'm using in the default margin/padding stripping.

#2 AndyB

  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 18 July 2006 - 04:06 AM


That might be relevant (by way of explanation, not as a solution).
Legend has it that reading the manual never killed anyone.
My site

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users