/    Sign up×
Community /Pin to ProfileBookmark

Fixed Position Column

Is there a way to keep a left column fixed using position-fixed, left and top positions, that will work in all screens, for a 950px, 2 column center aligned page? I want to keep the centered page and not have to place it on the left side of the screen, yet keep the left navigation column stationary and work on a fluid layout.

to post a comment
CSS

3 Comments(s)

Copy linkTweet thisAlerts:
@CentauriApr 09.2007 — You mean that the left navigation column is one of the columns of the two-column centred layout ? Getting it to remain stationary is simple in modern complient browsers, but IE cannot work it out. If the content scroll bar can be at the right side of the centred page, instead of at the edge of the window, then this can be done cross-browser easily enough. Not sure whether it could be done with a normal scroll bar position though. If the page can be full width rather than a fixed width, then a fixed navigation pane with normal looking scroll bar can be done.

Cheers

Graeme
Copy linkTweet thisAlerts:
@sticks464authorApr 09.2007 — You mean that the left navigation column is one of the columns of the two-column centred layout ?[/QUOTE]That's correct. I can get it to remain stationary with position:fixed left:XXX top:XXX, but when viewed on a different screen size it moves. I thought there might be a css way to have it adjust with screen size.
Copy linkTweet thisAlerts:
@CentauriApr 09.2007 — If you don't specify left and top values, but rather position by margins, the nav div will position relative to its container. Once you specify top or left, it is relative to the screen. However, using position:fixed doesn't work in IE, so you have to use something else if you want it to work in that browser.

The only other way I can think of would be to have the html, body and container all fixed to 100% height and hidden overflow which locks all those elements to screen size without scroll bars. The nav div will therefore not be able to move. The content column is then set to overflow:auto so that only it can scroll on long content. This will move the scrollbar to the side of the layout rather than the side of the window, but at the moment I can't think of any other way of doing it.

Cheers

Graeme
×

Success!

Help @sticks464 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...