Page 1 of 1
[solved] Locking the sidebar?
Posted: Sat Sep 15, 2007 8:09 am
by Evert
Hello, I'm working on a site for a company, but now I've run into a problem. I want to know how i can lock the sidebar, so that when I scroll down in the content area, the sidebar will stay at the same place.
The site is located at:
http://miracle.x10hosting.com/
So the picture of the necklace in the sidebar has to stay in place, even when I scroll down in the content area.
Second but less important question: I also want to know if the page wrapper can also be centered vertically?
Re: Locking the sidebar?
Posted: Sat Sep 15, 2007 7:16 pm
by KO
Now you have height for #content. You also have overflow Auto for it. This means that #content will have scroll bar if text- images inside it does not fit in. Since in contains both #sidebar and #main - scrolling will move both.
What I would do is to have #content height:auto (remove overflow:auto) and #main height:363px;overflow:auto. This way Image stays but #main will have scroll bar.
If you have page height allways same then you could have #pagewrapper position:absolute;
top:50%;
margin-top:-260px; <- half of pagewrapper height.
br, K
Re: Locking the sidebar?
Posted: Sun Sep 16, 2007 3:21 pm
by Evert
Thanks, that seems to work

Re: Locking the sidebar?
Posted: Sun Sep 16, 2007 6:27 pm
by KO
Nice:)
Remember to mark you first message subject [Solved]
Br, K
Re: Locking the sidebar?
Posted: Sun Sep 23, 2007 11:15 am
by Evert
I still have a problem with the vertically centering. It looks the way I want in Firefox, but is is screwd up in IE. What could the problem of this be?
Re: Locking the sidebar?
Posted: Sun Sep 23, 2007 2:00 pm
by KO
Your javascript image changing thingy is inside . That might be causing your problems.
br, K
Re: Locking the sidebar?
Posted: Sun Sep 23, 2007 2:22 pm
by Evert
I don't think that's the problem, the pages where I don't have the pictureslide are also screwd up in IE.
edit: Fixed it

Re: [solved] Locking the sidebar?
Posted: Mon Sep 24, 2007 4:59 pm
by Dr.CSS
How did you fix it?...