Reputation: 2732
I have the following layout...
The green elements repeats downward (they're tiles for a web-app).
The red column is a div with a fixed width, and the pink element also has a fixed size. The blue element is used elsewhere, and normally just takes the place of the green to sit in the red box - but under a special use case we need an options panel to come up on the side (the pink thing). So basically the blue element is a plain old div, no float, nothing like that.
Whenever I add the pink element, it appears below the blue. So I switched both blue and pink to inline-block, issue there is that the blue no longer grows to fill the extra space. So I'm at a loss.
How could I go about doing this, assuming that the red div cannot be changed? Thanks!
P.S. I don't need a complete code answer, just point me in the right direction and I'll fill in the dots.
Upvotes: 0
Views: 54
Reputation: 8981
try this
CSS
.container {
width: 100%;
display: Table;
background-color: black;
height: 400px;
padding: 10px;
}
.left {
display: Table-cell;
background-color: #0054A6;
width: 70%;
}
.right {
display: Table-cell;
background-color: #EC008C;
width: 30%;
}
HTML
<div class="container">
<div class="left">left</div>
<div class="right">right</div>
</div>
Upvotes: 1