I just started helping some work colleagues with some web design. Nothing major, but I have a problem with styled menu elements that are supposed to fill div area allocated and I noticed that whilst I can tweak width settings in ff by adding decimal points in them I noticed that in chromium, the gap between the last styled element and the div border is huge. I Checked the size and realised that chromium is showing the size(S) in rounded integer value. Anyone have any idea as to why this is?
I just started helping some work colleagues with some web design. Nothing major, but
Share
There is no such thing as fractional pixel. Pixel is the smallest screen unit.
The thing you’re experiencing happens because of the browsers math engines. Some of them round the decimal pixel part up to the next integer, and some of them floor it down.
To avoid that just define your pixels without decimal points. If you want to make the 2 elements visually closer you can play around with colors, for example – if you give a darker border to some elements they will seem to be closer – http://jsfiddle.net/fDbUj/