Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Aug 2005
    Thanked 0 Times in 0 Posts

    Scrolling Div Horizontally


    I'd like to be able to have a div that has content of text and images in it scroll horizontally, rather than the content and text always wrapping below and it scrolling vertically.

    Here is an example of what I'm trying http://noveis.net/scroll/
    But rather than the red and yellow images to be below, I want them to the right of the text, and then they div scrolls horizontally.

    One thing, I won't know the width of the content in the div before hand, so I can't use 2 divs, the outer one with the set width and the overflow:auto, and the inner one with the width of the content.

    Does anyone have a work around for this? I'd be willing to use Javascript if need be.

  • #2
    Regular Coder Doctor_Varney's Avatar
    Join Date
    Mar 2008
    Midlands, UK
    Thanked 29 Times in 28 Posts
    At the risk of sounding unhelpful, I think you'll find most users balk at horizontal scrolling because it's naturally more comfortable to read short widths of content, which scroll downwards. So my first question is: why does your design necessitate horizontal scrolling?

    But anyway, the solution you're looking for, is to apply a left float to your <p> as well as the images. Also, to the <h1> if you feel it necessary to have that floated left, too.
    In the usual run of things, most browsers should offer up horizontal bars, to access the material beyond the width of the box.

    There should be no need to use Javascript to create a layout; at least, not under normal, sane circumstances. That would be like using a spaceship, to tow a car out of mud.

    Hope this helps,
    Last edited by Doctor_Varney; 11-21-2008 at 09:34 AM.
    Definition: Computer rage is a heightened physiological response with associated feelings of anger and frustration[1] resulting from using a computer or other complex electronic device. It may result in the physical assault of the computer or similar item.[2] Computer use often leads to verbal abuse and occasionally physical violence towards the object.[3] Computer rage may be caused by distress due to a hardware or software problem which the enraged person is unable to correct.


    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts