I have this piece of HTML
<div class="box">
<div class="box-header">
<h4 class="box-header-title">CONTENT</h4>
</div>
<!-- rest of box -->
</div>
And I have this CSS:
.box {
display: inline-block;
min-width: 360px;
position: relative;
}
.box-header {
color: #fff;
}
.box-header-title {
padding: 0 2%;
}
What I want: That the .box.header-title
adjust it's padding according to the current width of .box-header-title
instead of .box
Right now, if .box
is 500px
computed value, the padding will be computed at 10px
. I want it to be computed at the current width of the element, instead of the parent box.