Web Hosting CSS & Stylesheet Forums

Add Me

User Name
Password
Go Back   CSS & Stylesheet Forums > CSS Forumz: Main > Style Sheet In General

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:



Reply
  #1 (permalink)  
Old 08-28-2008, 02:09 AM
Hugh Oxford
Guest
 
Posts: n/a
Diggs:
Default Scrollable div, left to right, inner divs



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.

Reply With Quote


Sponsored Links
  #2 (permalink)  
Old 08-28-2008, 02:09 AM
Ben C
Guest
 
Posts: n/a
Diggs:
Default Re: Scrollable div, left to right, inner divs

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.

Reply With Quote


  #3 (permalink)  
Old 08-28-2008, 03:36 PM
Hugh Oxford
Guest
 
Posts: n/a
Diggs:
Default Re: Scrollable div, left to right, inner divs

Ben C wrote:


Ben,

Thank you SO MUCH for this. You have no idea.
Reply With Quote


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 08:59 PM.
Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.




Inactive Reminders By Mished.co.uk