I’ve got a basic issue. Two <div>s side-by-side, the left <div> needs to be able to have a ‘flexible’ width, as in when the <div> on the right isn’t displayed, the left <div> will then stretch to 100%.
My code currently is as follows, which doesn’t fulfil the above requirement.
<html>
<head>
<style>
#container {
display: block;
}
#box-left {
width: 100%;
height: 100px;
background-color: red;
float: left;
}
#box-right {
width: 15%;
height: 100px;
background-color: blue;
float: right;
}
</style>
</head>
<div id="container">
<div id="box-left"></div>
<div id="box-right"></div>
</div>
<body>
</body>
Any pointers would be much appreciated.
Unfortunately, that doesn’t work in IE6, but apart from that it should do the trick.