Style on Div to avoid horizontal scrolling

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tom Szabo

    #1

    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


  • Ivo

    #2
    Re: Style on Div to avoid horizontal scrolling

    "Tom Szabo" wrote[color=blue]
    > 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[/color]
    content[color=blue]
    > exceeds the DIV's size.
    > Can it be made so only vertical scrollbars will appear?[/color]

    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



    Comment

    • David Dorward

      #3
      Re: Style on Div to avoid horizontal scrolling

      Ivo wrote:
      [color=blue]
      > Sure. Even without resorting to javascript. IE5 and up allow independent
      > setting of the properties with overflow-x and overflow-y[/color]

      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

      Comment

      • Martin Honnen

        #4
        Re: Style on Div to avoid horizontal scrolling



        David Dorward wrote:
        [color=blue]
        > Ivo wrote:
        >
        >[color=green]
        >>IE5 and up allow independent
        >>setting of the properties with overflow-x and overflow-y[/color]
        >
        >
        > Which (a) are not CSS and (b) won't work in browsers other then IE.[/color]

        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/

        Comment

        • Grant Wagner

          #5
          Re: Style on Div to avoid horizontal scrolling

          comp.lang.javas cript FAQ - http://jibbering.com/faq
          "Martin Honnen" <mahotrash@yaho o.de> wrote in message
          news:41bedbcf$0 $29843$9b4e6d93 @newsread2.arco r-online.net...[color=blue]
          >
          >
          > David Dorward wrote:
          >[color=green]
          > > Ivo wrote:
          > >
          > >[color=darkred]
          > >>IE5 and up allow independent
          > >>setting of the properties with overflow-x and overflow-y[/color]
          > >
          > >
          > > Which (a) are not CSS and (b) won't work in browsers other then IE.[/color]
          >
          > 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.[/color]

          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 <gwagner@agrico reunited.com>



          Comment

          • Thomas 'PointedEars' Lahn

            #6
            Re: Style on Div to avoid horizontal scrolling

            Martin Honnen wrote:
            [color=blue]
            > David Dorward wrote:[color=green]
            >> Ivo wrote:[color=darkred]
            >>> IE5 and up allow independent
            >>> setting of the properties with overflow-x and overflow-y[/color]
            >> Which (a) are not CSS and (b) won't work in browsers other then IE.[/color]
            >
            > These properties are part of CSS 3[/color]

            They are *not*, since
            [color=blue]
            > (currently a working draft
            > http://www.w3.org/TR/2002/WD-css3-box-20021024/ )[/color]

            | 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.
            ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^[color=blue]
            > and recent Mozilla trunks versions implement them.[/color]

            ,-<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...

            Comment

            Working...