[CSS] How to create a non-scrolling column

HTML, CSS and anything else that deals with client side capabilities.

Moderator: General Moderators

Post Reply
User avatar
techkid
Forum Commoner
Posts: 54
Joined: Sat Sep 05, 2009 11:18 pm
Location: Maldives

[CSS] How to create a non-scrolling column

Post by techkid »

Hello.

I want to know how to create a non-scrolling div column on top of the page. It should not scroll even the user scrolls the page.

Example: We have a toolbar in Facebook. Where chat and all are there.

Please help.

Thank you in advance.
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: [CSS] How to create a non-scrolling column

Post by califdon »

Might be a place to use an iframe. http://www.w3schools.com/TAGS/tag_iframe.asp
User avatar
techkid
Forum Commoner
Posts: 54
Joined: Sat Sep 05, 2009 11:18 pm
Location: Maldives

Re: [CSS] How to create a non-scrolling column

Post by techkid »

is there any other way? without iframe?
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: [CSS] How to create a non-scrolling column

Post by califdon »

techkid wrote:is there any other way? without iframe?
You could write a lot of Javascript code to capture whenever the user scrolls and then offset the relative position of the top div, but an iframe would be a lot easier. To see what would be involved, look at http://codepunk.hardwar.org.uk/ajs02.htm.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: [CSS] How to create a non-scrolling column

Post by pickle »

position:fixed If you don't care about IE.

You could also maybe put your header in 1 div, and the rest of the content in the other. Set overflow in the page to hidden, and the overflow in the div to scroll.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
kaszu
Forum Regular
Posts: 749
Joined: Wed Jul 19, 2006 7:29 am

Re: [CSS] How to create a non-scrolling column

Post by kaszu »

User avatar
daedalus__
DevNet Resident
Posts: 1925
Joined: Thu Feb 09, 2006 4:52 pm

Re: [CSS] How to create a non-scrolling column

Post by daedalus__ »

IE7+ support fixed positioning.

i wonder how many people really still use IE6?
User avatar
stoshrocket
Forum Newbie
Posts: 2
Joined: Wed Jan 20, 2010 10:00 am

Re: [CSS] How to create a non-scrolling column

Post by stoshrocket »

daedalus__ wrote:IE7+ support fixed positioning.

i wonder how many people really still use IE6?
20.99% still use IE6 as of December 2009, although with the recent security flaw people are being pushed (even by governments in the case of France and Australia) to upgrade from IE6.

Until this figure drops, I'd stick with iframes. Or just disable the element to IE6 users using an if statement in your CSS, displaying an "please upgrade" comment instead, but that's not very user friendly :P

EDIT: Changed user share from W3 statistics to Wikipedia average broswer share statictics (reference: W3 statictics, Multiple Sets of Data Collected on Wikipedia.)
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: [CSS] How to create a non-scrolling column

Post by Eran »

User avatar
daedalus__
DevNet Resident
Posts: 1925
Joined: Thu Feb 09, 2006 4:52 pm

Re: [CSS] How to create a non-scrolling column

Post by daedalus__ »

well if microsoft can ignore what mozilla users say when they have 20% i can feel okay about ignoring the 20% that still use IE6. usually the way i handle it is by displaying very large red letters saying that they should stop using ie6 immediately

haha, really though. that figure should drop as more and more people adopt windows 7 this year. i hope...

EDIT:

http://en.wikipedia.org/wiki/Internet_E ... #Criticism

HAHA AWESOME

im putting that on my website TODAY!
Post Reply