In below code I want up
and down
to float to right of the red line but they float past it to the div.
Why is this?
#outer {
margin-top: 50px;
margin-left: 50px;
width: 300px;
border: 1px solid lightgrey;
}
.inner {
border: 1px solid red;
padding: 15px 80px 15px 40px;
position: relative;
}
.up, .down {
border: 1px solid #000;
float: right;
}
.down {
clear: both;
}
<div id="outer">
<span class="inner">
<span class="quantity">Quantity</span>
<span class="up">up</span>
<span class="down">down</span>
</span>
</div>
See Question&Answers more detail:os