I have one problem with my code and I can’t find a solution.
I have left sidebar w: 300px h:100% , and I want the right div (content area) to be w: 100% and h:100% with horizontal scrollbar..
But something is wrong in my code and I cannot figure out, the right div is going over the side bar, and if I put margin-left:300px, then they 300px are added on those 100px weight.
I hope you understand me, here’s my code:
HTML:
<div id="wrapper">
<?php include '../side_bar.php' ?>
<div id="content">
<div id="scroll">
<img src="../images/design1.jpg" width="759" height="565">
<img src="../images/design1.jpg" width="759" height="565">
<img src="../images/design1.jpg" width="759" height="565">
</div>
</div>
</div>
CSS:
body, html {
margin: 0;
padding: 0;
height:100%;
width:100%;
}
#wrapper {
width:100%;
height:100%;
display:inline-block;
}
#side_bar {
float:left;
width:300px;
height:100%;
position:fixed;
border-right:#000 solid 1px;
}
#content {
float:left;
height:100%;
width:100%;
position:fixed;
}
#scroll {
height:100%;
width:100%;
display:inline-block;
position:absolute;
overflow-x:scroll;
overflow-y:hidden;
white-space: nowrap;
}
I was able to get the functionality you wanted with the following tweaked CSS:
Hopefully this helps!