Posted by Toby A Inkster on 02/09/07 12:33
Andy Dingley wrote:
> position:absolute; ties you into whatever you use as a length
> dimension (i.e. pixels / ems) for the top and left values.
Except when specifying a value of '0' which is often what I use when
absolutely positioning things. e.g.
<style type="text/css">
..wrap {
position: relative;
top: 0;
left: 0;
}
..main {
position: relative;
top: 0;
left: 0;
margin-left: 12em;
padding: 1em;
}
..nav {
position: absolute;
top: 0;
left: 0;
width: 12em;
padding: 0.5em;
}
..nav ul {
font-size: 80%;
}
</style>
<div class="wrap">
<div class="main">...</div>
<div class="nav">
<ul class="menu">...</ul>
</div>
</div>
is a reasonably simple and reliable method for a two-column layout. You
need to use a bit of jiggery-pokery for certain pre-7 versions of IE to
set ".nav { left: -12em; }" instead of ".nav { left: 0; }". IIRC, I've
gotten this working in IE4 before.
--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux
* = I'm getting there!
[Back to original message]
|