I'd like a left hand div for navigation, which can be fixed width. I'd like another div to be centered in the remaining space on the right hand side.
I thought I had it with the code here, but the centering is taking place across the full width, rather than just being centered within the right hand side.
I tried this but the centering ignores the floating LHS block. I tried making the divs have style="display:inline-block", but this didn't work either.
Any ideas how can I fix this please?
#left {
float: left;
width: 200px;
height: 200px;
background-color: cyan;
}
#right {
width: 100%;
height: 200px;
background-color: green;
border: 1px solid red;
}
#centrethis {
width: 400px;
height: 100px;
background-color: yellow;
margin-left: auto;
margin-right: auto;
}
<div id="left">
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
<li>Item 4</li>
</ul>
</div>
<div id="right">
right
<div id="centrethis">
centre this
</div>
</div>