tags:

views:

32

answers:

2

Hi,

I am trying to make some sort of timeline, but I can not keep the div floating horizontally.

I have a div container with overflow hidden. Inside the container I have divs floating to the left. Inside those div's are ul's with a fixed width.

If I resize the browser, I want the div to be gracefully cut off from the right side.

The current situation is that it floats underneath the previous one and leaving some ugly white space.

How can I maintain everything horizontally?

Any help is appreciated!

thanks in adv, Richard

EDIT

<STYLE>
    #bericht_container{ border: thin solid #000000; margin-left:20px; overflow:hidden; padding:10px;  width:900px;}
    DIV.bericht_maand{ float:left; margin-left: 20px; border: 2px solid #A0A0A4; }
</STYLE>
+2  A: 

You have to wrap them in a div that is the minimum width you want your page to be.

E.g.

#wrapper { width: 900px; }

<div id="wrapper">
    ... Your current HTML ...
</div>

You cannot have the div "dissapear" off the edge with CSS, but you could have the page show a horizontal scrollbar when this happens.

Graphain
Your width needs to be enough to accomodate both of them side by side.
Graphain
Thanks, I have this page where it is done gracefully, but I can't seem to duplicate the same behaviour?http://demo.tutorialzine.com/2010/01/advanced-event-timeline-with-php-css-jquery/demo.php
Richard
I think I see it now, It multiply's the divs in the container and sets the width of the container accordingly, I think? But that's jquery stuff. I thought it could be done with pure css.I will do some more testing to be sure!
Richard
You can use pure CSS - you just need to have your wrapper be at least as wide as the width of the stuff inside of it. It acts as a shield around them so they don't collapse.
Graphain
As far as I know though, to get what they have (without a horizontal scrollbar) you have to use JS.
Graphain
I think so too, thanks for your help, @Graphain!
Richard
A: 

I haven't tested it, but I think it should work if you set the div width to 100% and overflow hidden?

qw3n