473,569 Members | 2,480 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Style on Div to avoid horizontal scrolling


Hi,

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

style="BORDER:1 px ; OVERFLOW: auto; WIDTH:799px; HEIGHT:249px;po sition:
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
Jul 23 '05 #1
5 5881
Ivo
"Tom Szabo" wrote
style="BORDER:1 px ; OVERFLOW: auto; WIDTH:799px; HEIGHT:249px;po sition:
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/cs.../overflowx.htm >

You could also try wrapping your content in an 'inner div' which is set to
be slightly narrower than the 'outer div'.
--
Ivo
http://www.vansandick.com/
Jul 23 '05 #2
Ivo wrote:
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.

--
David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 23 '05 #3


David Dorward wrote:
Ivo wrote:

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.


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.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #4
comp.lang.javas cript FAQ - http://jibbering.com/faq
"Martin Honnen" <ma*******@yaho o.de> wrote in message
news:41******** *************** @newsread2.arco r-online.net...


David Dorward wrote:
Ivo wrote:

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.


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;overfl ow:-moz-scrollbars-vertical;

--
Grant Wagner <gw*****@agrico reunited.com>

Jul 23 '05 #5
Martin Honnen wrote:
David Dorward wrote:
Ivo wrote:
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.


These properties are part of CSS 3


They are *not*, since
(currently a working draft
http://www.w3.org/TR/2002/WD-css3-box-20021024/ )
| 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
--
Reboot is not a debugging technique...
Jul 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
19568
by: mr_burns | last post by:
Hi, Is it possible to disble horizontal scrolling using CSS? I want to try and use two backgrounds, one tiling vertically and part of the body background, which will not force scrolling, but one that will be part of a table stretching of to the right, which will force unwanted horizontal scrolling. How is this written in the stylesheet?...
4
3779
by: anna | last post by:
How to tell if a horizontal scrollbar is present? I only want to use scrollTo if horizontal scrollbar is present. window.scrollbars.visibility doesn't specify which scrollbar is present, so it gives a false result if there is vertical scrollbar but not horizontal scrollbar. TIA, Anna
2
2649
by: Just D. | last post by:
Does anybody know how to disable the horizontal scrolling on ASPX form? What JAVA script should be used for that? The standard methods don't help and I'm looking for some JAVA function to fire it onscroll event to scroll the page back. Actually it's a bug of ASPX pages, we can disable the vertical scrolling but horizontal scrolling works if we...
5
27930
by: delraydog | last post by:
I'm creating a dynamic iframe element: var iframe=document.createElement("iframe"); I want attach a style to the element, overflow-x:hidden. However, I can not find a way to do this via JavaScript. For example, the following do NOT work: iframe.style.overflow-x="hidden"; iframe.style="{overflow-x:hidden;"};
14
5402
by: Dave | last post by:
My web site is not particularly theme-based, but it contains an Art Gallery I'd like to display in a different perspective. I would like to horizontally scroll it, rather than vertically - as if the viewer is virtually "walking" through the gallery. I'm just attempting this to have this part of the page be different. Is horizontal scrolling...
3
3282
by: sumit | last post by:
Hi, I made a data grid vertically as well as horizontal scrollable as number of columns are very large!! But when i scroll horizontally then header is not visible as it also gets scrolled up,,so to tackle this i made a different data grid having only header as the row and the other datagrid contains the actual data for it,, Due to this...
0
1412
by: Dan Hinsley | last post by:
I just got one of the new Microsoft Mice that has a "tilt wheel" for horizontal scrolling. This works in a listbox in my VB.NET app, but doesn't work for a datagrid that does have a horizontal scroll bar. The same datagrid works with the wheel for vertical scrolling just fine. Is there something you have to do to catch the horizontal scroll...
3
5953
by: j0rd4n | last post by:
I have a user control that needs to allow vertical scrolling but not horizontal scrolling. In the user control's resize event, I need to adjust the size of all the children controls. For this to work correctly, I need the AutoScroll to not enable the horizontal scrollbar. After researching MSDN, I found the HScroll which can be used to...
16
1686
by: howa | last post by:
Is relative style design, e.g. relative font-size: em, % obsolete now? since most modern browsers now support automatic zoom in/out, even you are using fixed font-size.
0
7615
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8130
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7677
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6284
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3643
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2115
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
940
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.