[solved] Locking the sidebar?

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Post Reply
Evert
Forum Members
Forum Members
Posts: 10
Joined: Sat Sep 15, 2007 7:59 am

[solved] Locking the sidebar?

Post 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?
Last edited by Evert on Sun Sep 23, 2007 3:38 pm, edited 1 time in total.
KO
Power Poster
Power Poster
Posts: 562
Joined: Mon Nov 06, 2006 7:55 pm

Re: Locking the sidebar?

Post 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
Evert
Forum Members
Forum Members
Posts: 10
Joined: Sat Sep 15, 2007 7:59 am

Re: Locking the sidebar?

Post by Evert »

Thanks, that seems to work :)
KO
Power Poster
Power Poster
Posts: 562
Joined: Mon Nov 06, 2006 7:55 pm

Re: Locking the sidebar?

Post by KO »

Nice:) 

Remember to mark you first message subject [Solved]

Br, K
Evert
Forum Members
Forum Members
Posts: 10
Joined: Sat Sep 15, 2007 7:59 am

Re: Locking the sidebar?

Post 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?
KO
Power Poster
Power Poster
Posts: 562
Joined: Mon Nov 06, 2006 7:55 pm

Re: Locking the sidebar?

Post by KO »

Your javascript image changing thingy is inside . That might be causing your problems.

br, K
Evert
Forum Members
Forum Members
Posts: 10
Joined: Sat Sep 15, 2007 7:59 am

Re: Locking the sidebar?

Post 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 :)
Last edited by Evert on Sun Sep 23, 2007 3:38 pm, edited 1 time in total.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: [solved] Locking the sidebar?

Post by Dr.CSS »

How did you fix it?...
Post Reply

Return to “Layout and Design (CSS & HTML)”