I am facing an issue with my typical setup, where a div contains content with padding and uses the padding-right
property to create separation. However, when items near the right edge, both the padding-right
and overall padding (essentially padding-left
) from the parent div are being applied. How can I solve this problem?
#container {
padding: 20px;
}
#container div {
margin: 0 5px 5px 0;
width: 100px;
display: inline-block;
}
<div id="container">
<div></div>
<div></div>
<div></div>
<div></div>
</div>