I assume that you want these 3 divs to fill each with different content, the outsides filled with fluid or multi-line. Otherwise, the answer can be much 1) simpler. I also assume that the center of the div determines the overall height of the header.
Given these two questions, you can think of several different scenarios, of which I will give four examples from which you can choose the best suitable solution.
HTML is just yours.
CSS looks like this:
#Header_Container { width: 100%; position: relative; } #Header_Left { position: absolute; left: 0; right: 50%; margin-right: 480px; } #Header_Right { position: absolute; left: 50%; right: 0; margin-left: 480px; top: 0; } #Header_Center { width: 960px; position: relative; left: 50%; margin-left: -480px; }
Now you can change the behavior of the left and right with a few additional styles:
height: 100%; overflow: hidden;
See demo script .
1) When the parties may be partially invisible outside the browser window (in case you align the content in the left div to the right and vice versa), I propose a solution to this demo , which does not require absolute positioning at all, so that any content under the heading is correctly cleaned under any circumstances.
source share