I need help understanding why the border size is not matching the size I set in my CSS rules. Here is a link to the fiddle and below is the HTML code:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>P inside Body</title>
<link rel="stylesheet" href="stylesheets/working.css">
</head>
<body>
<h2>Hello World!</h2>
<p>
Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam,
eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam
voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem
sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non
numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam,
quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem
vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum
fugiat quo voluptas nulla pariatur?
</p>
</body>
</html>
And here is the CSS code:
body {
background-color: antiquewhite;
border: 10px solid black;
padding: 10px 20px 30px 40px;
margin: 10px 10px;
box-sizing: border-box;
color: darkblue;
}
p {
width: 400px;
padding: 10px 10px;
border: 3px solid red;
box-sizing: inherit;
}
While inspecting the <p>
element, the border size does not match 3px
precisely, instead it appears as 2.222
.
https://i.sstatic.net/BmlNQ.png
Any ideas why this discrepancy is happening?
Update
I am using Chrome Version 46.0.2490.80 (64-bit)
on Mac OS X Yosemite. The issue seems to be specific to Chrome's inspection tool. When I tried in Firefox (Version 41.0.2
), the border displayed the correct size of 3px
. The same was observed in Safari (Version 9.0 (10601.1.56.2)
). Both browsers showed size 3px
.
Any insights on why Chrome is behaving differently?