Hi there.
Any help with this would be amazing, I've created a simple code below for what I am trying to do, but I can't get it to behave how I wish.
I want...
- #topmenu and #sidemenu to be fixed when scrolling (which works)
- #extracontent to have a fixed width and be floated to the right of the page (which works)
- #middlecontent should resize to the width between #sidemenu and #extracontent when the browser is resized horizontally.
Is that last point possible? If so does anyone have any advice how I can acheive this? At the moment it pushes down the #extracontent and I'm pretty sure the fixed width will be sitting on top of some of #middlecontent
Any help would be great
Code:
<!DOCTYPE html>
<head>
<title>sweet layout</title>
<style type="text/css" media="screen">
#container {
width: 100%;
height: 1000px;
}
#topmenu {
position: fixed;
top: 0px;
left: 0px;
height:30px;
width: 100%;
background:red;
}
#sidemenu {
position:fixed;
top: 30px;
left: 0px;
width: 200px;
height: 100%;
background: blue;
}
#middlecontent {
float: left;
height: 100%;
background: yellow;
width: 100%;
}
#extracontent {
float: right;
width: 300px;
height: 100%;
background: orange;
}
</style>
</head>
<body>
<div id="container">
<div id="topmenu">fixed</div>
<div id="sidemenu">fixed</div>
<div id="middlecontent"></div>
<div id="extracontent"></div>
</div>
</body>
</html>