Adam K Dean

Natural box layout model

Published on 15 July 2013 at 12:58 by Adam

Unfortunately, browsers do not always implement the default CSS rules that we would like. One rule which should almost definitely be added to every browser ever is the following, applying border-box box-sizing to, well, everything.

/* apply a natural box layout model to all elements */
* { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; }

Thanks go to Paul Irish if I remember correctly.



This post was first published on 15 July 2013 at 12:58. It was filed under archive with tags css.