Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The most relative units are calculated in turns of the font size of the root element (usually 1rem = 16px). I find it a lot easier to read and maintain units that are based on the font-size of the current element (e.g. `em`, `ex`, and `ch`). “This element has block margins 2 times the size of the font”, as opposed to some magic absolute `px` or `rem`. Also if margins and paddings are defined relative to the font-size (e.g `padding: 1ex 1em;`) resizing the entire element with `font-size` is way more manageable.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: