Could somebody explain why the following code doesn't work?
html
<div id="content">
<div class="sidebar">1</div>
<div class="sidebar">2</div>
</div>
css
#content {
padding:0;
margin:0;
}
.sidebar {
width: 50%;
display: inline-block;
margin: 0;
padding: 0;
}
I would expect the sidebars to be side by side, but they are not. I don't even know where to start. I know I can use float: left
, but how can I get this working with inline-block
?