Lets say we have a parent div of maximum width of document, and we have a child div with also maximum width, so child covered the parent div. Now if we put padding-right: 50px and padding-left 50px for example why does it push the child div from inside meaning it decreases its width?
parent div is color red and child is color blue, parent div is 100% width of document.
Code:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<link href="CSS/style.css" type="text/css" rel="stylesheet">
</head>
<body>
<div id="wrapper">
<div id="box">
</div>
</div>
</body>
</html>
#wrapper {
background: rgba(135,45,46,1.00);
height: 200px;
padding-right: 50px;
padding-left: 50px;
}
#box {
background: rgba(72,175,184,1.00);
height: 200px;
}