I have a div with 100% width and some padding. The div is larger than it's wrapper. Obviously I don't want that to happen. I can not work with pixels on the width as the width is dynamic.
I've tried out various CSS tricks and searched through stackoverflow. I can not imagine how nobody asked about this probably simple problem yet, but I really found nothing that works so far. That said, please excuse me if this might still be a duplicate question.
.entryrow {
position:relative;
width:100%;
height:100px;
background: linear-gradient(#2c647b,#191654);
box-sizing:border-box;
display: inline-block;
padding:5px;
margin:5px 5px 0 5px;
border:1px solid #ccc;
cursor:pointer;
}
<div style="width:100%;background:black;height:120px;">
<div class="entryrow">
Blubb
</div>
</div>