Jump to content

[SOLVED] horizontally scrolling with DIVs?


michaellunsford

Recommended Posts

Trying to figure out how to embed numerous divs inside one div and have overflows scroll horizontally?

So far, to get the numerous other divs to line up horizontally, I have used display:table-cell; If I use display:inline; instead, the width attribute gets ignored.

I've seen this done somewhere but I can't find it. Any ideas?
Link to comment
Share on other sites

if this helps, this is what I have:

[code]
<div style="width:100%; height:125px; text-align:center; overflow:auto;">
<div style="width:200px; text-align:center; display:table-cell; ">
<img src="gallery/pic4.jpg" width="150" /></div>
<div style="width:200px; text-align:center; display:table-cell; ">
<img src="gallery/pic2_001.jpg" width="150" /></div>
<div style="width:200px; text-align:center; display:table-cell; ">
<img src="gallery/pic1.jpg" width="150" /></div>
<div style="width:200px; text-align:center; display:table-cell; ">
<img src="gallery/pic3.jpg" width="150" /></div>
</div>
[/code]

some browsers align the "cells" vertically -- but I'd like to go horizontally. Thoughts?
Link to comment
Share on other sites

This isn't really intended as help (although it might), but while googling for a solution for you I came across http://www.thehorizontalway.com which I thought was odd enough to mention here. Maybe more googling will reveal other wonders - and maybe even a solution for you.
Link to comment
Share on other sites

Well, it didn't work. The method they used was actually applied to the entire page. After digging and googling a bit, I found someone else couldn't get nested DIVs to do it, he had to use a table inside the DIV to guarantee horozontal scrolling.

This I did, and it worked. I guess tables aren't so evil after all ;D
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.