I would like my absolutely positioned element to:
- be positioned always at the bottom of the container element.
- span across the whole container element.
- not span over the padding of the container element.
The container div has a %
based width.
You can see my problem here: http://jsfiddle.net/vTuTv/2/
.container {
min-height: 200px;
width: 50%;
background-color: #3e3e00;
position: relative;
padding-left: 15px;
padding-right: 15px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.line {
background-color: #003e3e;
position: absolute;
bottom: 0;
height: 22px;
width: 100%;
}
<div class="container">
<div class="line"></div>
</div>
Obviously if the element wasn't absolutely positioned then I could just use box-sizing
on the parent element.