Using decimal percentage values in responsive design

Divya takes a look at why we’re using so many decimals places when it comes to percentage based widths. why, Why, WHY?

At work I get many samples of code to be reviewed, most of them with a warning ‘only works in Chrome’. Nevertheless, I open these pages in Safari & mostly they work. Yesterday I came across something that didn’t. This post is a result of that investigation.

The page layout was broken in Safari and as I turned on the Inspector, I noticed the way the values were being specified:

margin: 0 0 0 6.3124621208203820812122%;
width: 48.121212121212121212121212% 

(The values are not the same as the ones I saw in the code, but the number of decimals used is similar)

An excerpt from Using decimal percentage values in responsive design

View original article

Subscribe to our Newsletter

Add your email address and receive an email every Friday covering off everything worth knowing about building your websites responsively.