Welcome to WebmasterWorld Guest from 107.22.83.0

Forum Moderators: incrediBILL

Message Too Old, No Replies

how hide scroll bar in the web pages?

how hide scrol bar in the web pages?

     
1:56 pm on Jun 16, 2007 (gmt 0)

New User

joined:June 10, 2007
posts:9
votes: 0


the right of each page there are a scroll bar for see full pages and u can up and down it!
but i want hide it in my pages

how i can?

11:15 am on June 17, 2007 (gmt 0)

Senior Member

WebmasterWorld Senior Member penders is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:July 3, 2006
posts: 3123
votes: 0


IE6 will display the greyed out scrollbar on the page even if the content fits. FF and Opera will only display the scrollbar if the content spills out of the viewport.

In FF and Opera you can get rid of the scrollbar (even if the scollbar *should* appear) by setting:

body { 
overflow:hidden;
}

But you won't get able to get at the contents which is out of view! In IE6 the scrollbar will ALWAYS show on the body.

1:14 am on June 18, 2007 (gmt 0)

Preferred Member

10+ Year Member

joined:Feb 28, 2005
posts: 646
votes: 0


Actually, itís not that IE will always display the scrollbar, itís that the scrollbar isnít on
body
:)

Itís actually on

html
in IE. Which is wrong, Iím pretty sure: I think itís meant to be on
body
.

Anyway, update it to this:

html, body { overflow: hidden; }

Ö and IE 6 and 7 will remove the scrollbar just fine.

7:02 am on June 18, 2007 (gmt 0)

Senior Member

WebmasterWorld Senior Member penders is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:July 3, 2006
posts: 3123
votes: 0


Actually, itís not that IE will always display the scrollbar, itís that the scrollbar isnít on body :)

Itís actually on html in IE. ...

Ah, OK, thanks for the clarity! :)

I notice that in IE6 (may be 7?) that you can still get at the hidden contents by selecting the content and moving up/down with the mouse. But not in FF or Opera.

7:21 am on June 18, 2007 (gmt 0)

Preferred Member

10+ Year Member

joined:Feb 28, 2005
posts:646
votes: 0


Yep, that happens in IE 7 too :)

I tend to avoid a practice like this just for kicks (for instance if someone wanted their own customised scrollbar colours etc) because itís a user interface control that should not be mucked with by designers.

I could quote Spiderman right now but I think Iíve done it before and Iíll just sound like an old man repeating stuff Iíve already saidÖ :)

8:59 am on June 21, 2007 (gmt 0)

New User

10+ Year Member

joined:May 14, 2007
posts:20
votes: 0


Their is a problem with. Once you resize the window, the scrollers never appears and the content are not fully showed. It will be better it you use following.

<style type="text/css">
html, body { overflow:auto }
</style>

Once you resize the window, ithe scrollers will be displayed automatically.

Regards
Qasim Ali

9:17 am on June 21, 2007 (gmt 0)

Senior Member from MY 

WebmasterWorld Senior Member vincevincevince is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Apr 1, 2003
posts:4847
votes: 0


abbas13... I'm mighty glad I've not encountered your site using my PDA, or the ancient laptop I keep in my room which only does 640x480px.