Whenever a non-integer pixel value is used for the border of an element, the browser simply truncates the value to become an integer. Why is this the case?
I\'m aware th
As far as I can tell from a few simple tests, subpixel border widths work exactly as they should. I think a typo in you example ("border-top-width" vs. "border-left-width") may be the cause of the discrepancy. This example works as expected for me:
var div = document.getElementsByTagName("div");
for (var i = 0; i < div.length; i++)
{
div[i].innerHTML += getComputedStyle(div[i]).getPropertyValue("width");
}
DIV
{
width: 300px;
border: 1px solid black;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
DIV.subpixel
{
border-width: 1.23px;
}
border-width: 1px
width:
border-width: 1.23px
width: