![]() |
|
Welcome to the CSS & Stylesheet Forums forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
| Tags: |
![]() |
|
|||
|
Dear all, I am here our of desperation, having RTFM'd and hacked for hours. What I want is simple. I want a left to right scrollable div, containing other divs. Eg. <div id="outerdiv" width="400px" height="100px" style="overflow-x:scroll"> <div class="innerdiv" width="100px">bar</div> <div class="innerdiv" width="100px">bar</div> <div class="innerdiv" width="100px">bar</div> <div class="innerdiv" width="100px">bar</div> <div class="innerdiv" width="100px">bar</div> </div> So that I can scroll along, left to right, and view the divs within. A bit like the Apple Store. No matter what I try, the inner divs stack up on top of one another. I have tried float:left and float:right. This puts them in a row, but when the total width exceeds the width of the containing div, it creates a new row, rather than activating the scrollbar and allowing scrolling. I would be very grateful for some help here, or even a workaround. |
| Sponsored Links |
|
|||
|
On 2008-08-27, Hugh Oxford <arestes@fas.com> wrote:
> Dear all, > > I am here our of desperation, having RTFM'd and hacked for hours. > > What I want is simple. > > I want a left to right scrollable div, containing other divs. > > Eg. > > ><div id="outerdiv" width="400px" height="100px" style="overflow-x:scroll"> <div style="width: 10000px"> > > <div class="innerdiv" width="100px">bar</div> > <div class="innerdiv" width="100px">bar</div> > <div class="innerdiv" width="100px">bar</div> > <div class="innerdiv" width="100px">bar</div> > <div class="innerdiv" width="100px">bar</div> </div> ></div> You can put another div in as indicated above. Then float: left the innerdivs. Don't use width="400px" on a div. It's all wrong even if it might work. "width: 400px" should go in the styles, like this for example: <div id="outerdiv" style="overflow: scroll; width: 400px; height: 100px"> Overflow-x is CSS3. Current browsers are CSS2.1 plus a few bits. Overflow-x works in most of them but you don't need it. > So that I can scroll along, left to right, and view the divs within. A > bit like the Apple Store. |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
- Contact Us
-|-
CSS & Stylesheet Forums -|-
Archive -|-
Top -|-Rules/Disclaimer-|-Help/Support-|-Advertise