Search code examples
htmlgoogle-chromewidthfont-size

HTML using 'em' for border-width won't work on Chrome?


I'm trying to use 'em' for sizing all my HTML elements, including the border for divs and imgs.
But when I use css: border: .1em #000000 solid; on one of my divs, It won't show in Google chrome but in Firefox and IE. Am I using it in the wrong way? or it's one of Chrome's bugs?
In anyway, how may I fix it? or is there any other way to work around it?


Solution

  • If 0.1em computes to a value that is less than 1px, it may be ignored depending on how the browser chooses to round values. Perhaps it's the case that Firefox and IE round numbers, whereas Chrome floors them. You should probably just use a value of 1px instead of using em for absolutely everything.