If you try to pass margin-left to a C1 div, it moves and the overflow is hidden. But if you try to pass margin-left to div C2, it moves to the right, but the overflow does not hide, but moves to the next line ( inline-block behavior).
So why doesn't it work on a C2 div? Is there any way to solve this problem?
(Basically, I want the separators C1 and C2 to be placed together, and the overflow should be hidden if I increase their width, or if I give them fields).
Here is what I am trying:
.c1 { width: 220px; height: 200px; background-color: #666666; display: inline-block; } .c2 { width: 200px; height: 220px; background-color: #CCCCCC; display: inline-block; } .c3 { width: 180px; height: 210px; background-color: #333333; display: block; } .wrapper { background-color: red; width: 500px; height: 500px; display: inline-block; overflow: hidden; }
<div class="wrapper"> <div class="c1">C1</div> <div class="c2">C2</div> <div class="c3">C3</div> </div>
html css
Vikas Kumar
source share