Forum Moderators: not2easy
<div id="rightBar"> </div>
and the css is:
#rightBar {
position: absolute;
z-index: -10;
right: 25px;
margin-top: 10px;
margin-bottom: 0px;
width: 125px;
height: 100%;
min-height: 100%;
border: 1px solid #797979;
border-bottom: 0px;
background-color: #eee;
}
body and html are both set to height: 100%
On IE and Opera, it seems to work fine. On Netscape, it doesn't even show up. In Mac IE, it doesn't go all the way to the bottom of the page, and I don't think it shows in Safari, either. Does anyone know how to make the height follow the size of the page, even if the height needs to be bigger than the viewport? Thanks, guys.
[edited by: Nick_W at 8:29 pm (utc) on June 4, 2003]
[edit reason] see sticky mail [/edit]
Why do you need a negative z-index anyways? Why not leave it at the initial 'auto' value?
If you want navigation bar stretch to the full height of the page, you can do it like this:
body {
background: url('bar_background.gif') repeat-y;
margin-left: 200px; /* width of your bar */
}
#bar {
position: absolute;
top: 0;
left: 0;
width: 200px; /* width of your bar */
}
This way your bar's DIV will not be 100% height, but it will look like it is because of colored left margin area.
body {
margin: 0;
margin-top: -10px;
height: 100%;
background-image: url(images/background.gif);
background-position: 100% 15px;
background-repeat: repeat-y;
}
I wanted it on the right side, because I like the idea of the nav bar being on the side where the cursor is usually located: the scrollbars. However, I have a heading box that I wanted to sit about 5-10px below the border of the body, and I didn't want the bar to be seen above it. Therefore, I placed a small spacer <div> above the heading box with a background color of #fff, and it served to push the heading box down, while blockout the background image at the same time. The reason why the body margin is -15px is because for some reason, NS 6.2 would still have a small space above the spacer where you could see the bg image. I made the margin negative, and made the spacer a tad bigger, and now my layout looks perfect in IE 6, NS 6.2, Opera 7, Mac IE 5.2, and Safari! Thanks for the help, guys..it's really appreciated.