Obsession
Watching
You're Beautiful
Liar Game 2
Autumn's Concerto
Playing
World of Warcraft
WOW Character
Nick: Wishix
Lv: 80
Race: Blood Elf
Class: Priest
Guild: Intoxicated
Server: Thaurissan
Nick:Wishie
Lv: 80
Race: Undead
Class: Dark Knight
Guild: Singabombz
Server: Thaurissan
Layout using absolute positioning
You can create a traditional two-column layout with absolute positioning if you have something like the following HTML:<div id="navigation"> <ul> <li><a href="this.html">This</a></li> <li><a href="that.html">That</a></li> <li><a href="theOther.html">The Other</a></li> </ul> </div> <div id="content"> <h1>Ra ra banjo banjo</h1> <p>Welcome to the Ra ra banjo banjo page. Ra ra banjo banjo. Ra ra banjo banjo.And if you apply the following CSS:
Ra ra banjo banjo.</p> <p>(Ra ra banjo banjo)</p> </div>#navigation { position: absolute; top: 0; left: 0; width: 10em; } #content { margin-left: 10em; }
#navigation { position: absolute; top: 0; left: 0; width: 10em; } #navigation2 { position: absolute; top: 0; right: 0; width: 10em; } #content { margin: 0 10em; /* setting top and bottom margin to 0 and right andThe only downside to absolutely positioned elements is that because they live in a world of their own, there is no way of accurately determining where they end. If you were to use the examples above and all of your pages had small navigation bars and large content areas, you would be okay, but, especially when using relative values for widths and sizes, you often have to abandon any hope of placing anything, such as a footer, below these elements. If you wanted to do such a thing, it would be necessary to float your chunks, rather than absolutely positioning them.
left margin to 10em */ }
#navigation { float: left; width: 10em; } #navigation2 { float: right; width: 10em; } #content { margin: 0 10em; }If you do not want the next element to wrap around the floating objects, you can apply the clear property. clear: left will clear left floated elements, clear: right will clear right floated elements and clear: both will clear both left and right floated elements. So if, for example, you wanted a footer to your page, you could add a chunk of HTML with the id 'footer' and then add the following CSS:
#footer {
clear: both;
}And there you have it. A footer that will appear underneath all columns, regardless of the length of any of them.