This is a section of my code:
CSS :
.body .left, .right {
position:relative;
z-index:6;
display:inline-block;
}
.body .left {
top:0;
left:0;
width:100px;
height:300px;
margin-right:10px;
border:1px solid #333;
}
.body .right {
top:0;
width:100px;
height:300px;
border:1px solid #333;
}
And HTML
<div class="body">
<div class="left">
</div>
<div class="right">
</div>
</div>
I would like the top:0;
property to be on one line when there is no content added to either .left
or .right
div
. It works fine in that scenario, but when text or something else is added to either .left
or .right
div
, the divs are arranged differently. Please check out the example on JsFiddle to see what I mean.
View Example : JsFiddle