I've encountered a challenge in HTML/CSS with my desired setup. I am looking for:
- A header panel that remains fixed at the top of the page, stretching to fill the available width while also having a minimum width;
- A content section that can be scrolled vertically and shares the same minimum width as the header;
- If the minimum width exceeds the width of the browser window, a horizontal scrollbar should appear to move both the header and content together (not independently).
This is what I have so far. What could be missing?
<html>
<head>
</head>
<body style="overflow:hidden;position:relative">
<div id="big-container" style="overflow-y:hidden">
<div id="header" style="position:absolute;top: 0px;left:0px;height:80px;width:100%;min-width:1000px;background-color:blue">
Header
</div>
<div id="container" style="min-width:1000px;position:absolute;top: 80px;left:0px; height:100%;width:100%;padding-bottom:80px;box-sizing:border-box;overflow:hidden">
<div id="content" style="height:100%;width:100%;overflow-y:auto;overflow-x:hidden">
<img src="http://www.fronetics.com/wp-content/uploads/2013/12/networking.jpg" />
</div>
</div>
</div>
</body>
(For clarity, I kept styles and content separate above - they are combined here only for brevity.)