My issue is that when I apply a border to a div, the content inside no longer fills up 100% of the width and height.
I have already tried adding padding: 0;
, margin: 0;
, and box-sizing: border-box;
, but the background still shows at certain zoom levels.
I'm wondering if this could be a browser bug? The red background does not show on Firefox, but Firefox has different zoom levels than other browsers.
#outside {
box-sizing: border-box;
background: red;
border: 1px solid #808080;
border-radius: 12px;
height: 500px;
overflow: hidden;
padding: 0;
margin: 0;
}
#content {
background: green;
height: 100%;
padding: 0;
margin: 0;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8>
<meta http-equiv="X-UA-Compatible" content="IE-edge">
<meta name="viewport" content="width=device-width, initial-scale=1;>
<title>Document</title>
</head>
<body>
<div id="outside">
<div id="content">
</div>
</div>
</body>
</html>