I tried several resources (SO as well) on the internet but I simply can't solve this one.
There are just four floated divs on a web page.
- divs 1, 2 and 4 have fixed width
- div 3 has to take up the rest of the width
- div 2 and 3 have to have a padding in between
- all divs MUST have padding=0 (requirement for Sly scrolling library)
Here is the schematic diagram of what I'm trying to do in my page:
+-----------+--+ +---------------------------+--+
| 1 |2 | | 3 |4 |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
+-----------+--+ +---------------------------+--+
No matter what I try, I can't get div 3 to take up rest of the width, while maintaining padding between div 2 and div 3. This was my last attempt:
HTML
<div id="slyFrame_parent">
P
</div>
<div id="slyScrollbar_parent">
S
</div>
<div id="slyScrollbar_child">
S
</div>
<div id="slyFrame_child">
P
</div>
CSS
#slyFrame_parent {
padding: 0px;
float: left;
height: 500px;
width: 60px;
border: 1px solid #333;
}
div#slyScrollbar_parent {
padding: 0px;
float: left;
height: 500px;
width: 16px;
border: 1px solid #333;
border-left: 0px none;
}
#slyFrame_child {
padding: 0px;
overflow: hidden;
height: 500px;
width: auto;
margin-left: 5px;
border: 1px solid #333;
}
div#slyScrollbar_child {
padding: 0px;
float: right;
height: 500px;
width: 16px;
border: 1px solid #333;
border-left: 0px none;
}
FIDDLE
http://jsfiddle.net/ozrentk/jw73j/
Is there a solution to it?