Suppose there is some code like this http://jsfiddle.net/h0czgwgu/
. left {
width: 50px;
height: 50px;
border: 1px solid black;
float: left;
background-color: white;
}
.content {
width: 100%;
height: 10px;
margin: 3px;
border: 1px solid black;
background-color: green;
}
& lt; div class = "left" & gt; & lt; / div & gt;
& lt; div class = "content" & gt; & lt; / div & gt;
& lt; div class = "content" & gt; & lt; / div & gt;
& lt; div class = "content" & gt; & lt; / div & gt;
& lt; div class = "content" & gt; & lt; / div & gt;
& lt; div class = "content" & gt; & lt; / div & gt;
& lt; div class = "content" & gt; & lt; / div & gt;
& lt; div class = "content" & gt; & lt; / div & gt;
& lt; div class = "content" & gt; & lt; / div & gt;
& lt; div class = "content" & gt; & lt; / div & gt;
Answer 1, authority 100%
Remove width, add overflow: hidden
and drag margin
to float edge:
. left {
width: 50px;
height: 50px;
border: 1px solid black;
float: left;
background-color: white;
margin-right: 3px;
}
.content {
height: 10px;
margin: 3px 0;
border: 1px solid black;
background-color: green;
overflow: hidden;
}
& lt; div class = "left" & gt; & lt; / div & gt;
& lt; div class = "content" & gt; & lt; / div & gt;
& lt; div class = "content" & gt; & lt; / div & gt;
& lt; div class = "content" & gt; & lt; / div & gt;
& lt; div class = "content" & gt; & lt; / div & gt;
& lt; div class = "content" & gt; & lt; / div & gt;
& lt; div class = "content" & gt; & lt; / div & gt;
& lt; div class = "content" & gt; & lt; / div & gt;
& lt; div class = "content" & gt; & lt; / div & gt;
& lt; div class = "content" & gt; & lt; / div & gt;