Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS [Solved] px versus em, who wins? Reply To: px versus em, who wins?

#151873
tomasz86
Participant

What you may want to be careful about is using ems for things like borders. Normally you would convert 1px to 0.0625em but if the font-size of the element is smaller than 16px then the border may not be displayed at all. This behaviour seems to be inconsistent depending on the browser you’re using.

Check: http://codepen.io/tomasz86/full/EmuCx

The last div’s border won’t be displayed at all in old Opera (Presto) and Webkit browsers. It will be displayed in IE and Firefox.