[thelist] CSS question (Martin? Rudy?)

Scott Schrantz scotts at rci-nv.com
Thu Jun 6 23:01:06 CDT 2002


> -----Original Message-----
> From: Techwatcher [mailto:techwatcher at accesswriters.com]
>
> The "site" is at http://camilio.accesswriters.com
>
> Also, the fixed position doesn't do what I expected (it scrolls with
> the page). Any comments from the experts before I hit the
> "books" again?

positon: fixed doesn't work in IE. Not gonna happen, so don't lose sleep
over it. If you look at your site in Mozilla, it does what you want, but the
menu is too wide and overlaps the content. Setting a width:100px on the menu
might fix that, as well as playing with the margins and padding on the <ul>.

> for what element (or classes?) can I assign large margin values, but
> set to 0 left-margin for the part of the page where I want the nav
> list? I was hoping to set large margins for body, but reset them for
> H1, and that didn't work. When I finally had access to a CSS-capable
> browser (my development machine has an ancient browser), it turned out
> I had to add in CSS rules for all the elements individually (UL, P, etc.).

Use <div>s to handle the positioning. If you do something like this:
(disclaimer: I'm not that good at CSS-P myself)

<div id="nav">
<!-- Menu -->
</div>

<div id="bodytext">
<!-- Rest of the page -->
</div>

You can then apply positioning to those divs:
#nav {
width: 100px;
position: fixed;
top: 0px;
left: 0px;
}
#bodytext {
position: absolute;
left: 120px;
top: 0px;
}

Put the entire page inside those divs, and you'll be well on your way.
Nothin's gonna get that menu to stay put in IE, though. It treats position:
fixed just like position: absolute.
See here:
http://www.computer-vet.com/clients/camilio/index.html



More information about the thelist mailing list