Search code examples
htmlcssgoogle-chromehamlmozilla

Why in Chrome and Firefox different element width?


I have .sidebar with width: 25em; margin: 0; padding: 0;. And on Chrome width = 169.6px, on Firefox width = 260px.

Why? How is the width in firefox considered?


Solution

  • "em" is a unit based on typography size. The font size in different browsers might be different (by default), thus the X * < font size > will have a different outcome Set a font-size for the web page and try again