Style on Div to avoid horizontal scrolling

T

Tom Szabo

Hi,

Is it possible to have only vertical scrolling enabled on a DIV?

style="BORDER:1px ; OVERFLOW: auto; WIDTH:799px; HEIGHT:249px;position:
absolute; top:0; left:0; "

will have both horizontal and vertica scrollbars once the dim of the content
exceeds the DIV's size.

Can it be made so only vertical scrollbars will appear?

TIA,

Tom
 
I

Ivo

style="BORDER:1px ; OVERFLOW: auto; WIDTH:799px; HEIGHT:249px;position:
absolute; top:0; left:0; "

will have both horizontal and vertica scrollbars once the dim of the content
exceeds the DIV's size.
Can it be made so only vertical scrollbars will appear?

Sure. Even without resorting to javascript. IE5 and up allow independent
setting of the properties with overflow-x and overflow-y, see for example
< http://www.blooberry.com/indexdot/css/properties/position/overflowx.htm >

You could also try wrapping your content in an 'inner div' which is set to
be slightly narrower than the 'outer div'.
 
D

David Dorward

Ivo said:
Sure. Even without resorting to javascript. IE5 and up allow independent
setting of the properties with overflow-x and overflow-y

Which (a) are not CSS and (b) won't work in browsers other then IE.
 
G

Grant Wagner

comp.lang.javascript FAQ - http://jibbering.com/faq
Martin Honnen said:
These properties are part of CSS 3 (currently a working draft
http://www.w3.org/TR/2002/WD-css3-box-20021024/ ) and recent Mozilla
trunks versions implement them.

And in the meantime, while you're waiting for standards to shake out, if
you want something that works in IE (and possibly Opera 7) and
Gecko-based browsers, you can try:

overflow-x:hidden;overflow:-moz-scrollbars-vertical;
 
T

Thomas 'PointedEars' Lahn

Martin said:
These properties are part of CSS 3

They are *not*, since

| This draft should not be cited except as "work in progress." It is a work
| item of the CSS working group which is part of the Style activity (see
| summary). It may be modified or dropped altogether at any point in time.
| Implementations for the purpose of experimenting with the specification
| are welcomed, as long as they are clearly marked as experimental.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
and recent Mozilla trunks versions implement them.

,-<ftp://ftp.mozilla.org/pub/mozilla.org/mozilla/nightly/README>
|
| This directory contains precompiled binaries of Mozilla.
| These are NIGHTLY BUILDS. They are completely untested.
| We don't even know if they start up without crashing.
| They expire in 30 days.

When will they ever learn?


PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top