Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS display:table with fractional pixel width

Tags:

html

css

I am using percentages to create the width of a div with the display property set to table. In my case, the width of the parent div is 88.7969px. So it stands to reason that setting the width of child div with the display property set to table to 100% would compute the width to be 88.7969px. This, however is not the case. It computes the width to be 88px.

Is a fractional pixel width of table displays not supported?

Here's the fiddle. If you inspect the elements, you'll see the content wrapper at 88.7969px but the inner child div at 88px.

wtf

like image 721
Jason Strimpel Avatar asked Feb 09 '16 03:02

Jason Strimpel


1 Answers

No there is nothing to do with display:table with a fractional pixel value.

It completely depends upon the Browser and Browser Version which you are using.

Current Versions as of 9 FEB 2016::: on Google Chrome the div with fractional pixel value with display:table is rounded up, while in Firefox it is not and also in IE it is not rounding up.

like image 68
kanudo Avatar answered Nov 03 '22 06:11

kanudo