Posted By

pckujawa on 01/16/07


Tagged

fix css tweak gotcha kludge


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

basicmagic
vali29
stoker


CSS oddities and their fixes


 / Published in: CSS
 

Most of these come from the book "CSS Mastery: Advanced Web Standards Solutions," a must-read by Andy Budd (seriously, even if you've used CSS for years, you'll learn a good deal of new things from this book; beginners should read this immediately after learning a bit of CSS).

  1. Never add padding to an element with a defined width due to IE errors. Instead, add padding to the element's children. (Budd page 30)
  2.  
  3. Margin-collapsing only happens with vertical boxes in the normal flow. (Budd 33)
  4.  
  5. Vertical spacing will not affect an inline box, but setting the line-height will. (Budd 33)
  6.  
  7. In IE 5.5 and 6, if you try to set the position of an absolute box relative to a relatively-positioned box, you need to specify the width and height of that relatively-pos. box. (Budd 36)
  8.  
  9. All about clearing on page 41.
  10.  
  11. More to come... Please add your own.

Report this snippet  

You need to login to post a comment.