You are here: Re: Layout using position « HTML « IT news, forums, messages
Re: Layout using position

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!

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация