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