Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS: Floating two div elements with 100% width off screen?

I remember asking this question a while back but i can't seem to find it again! I've searched but i can't seem to find the solution i'm looking for.

Let's say i have two divs with 100% width floated next to each other. As they take up the entire screenwidth, there is no longer any space left for them to float on, and therefore the second div appear below the first one. What i want is to make the second div continue floating off screen next to the first one.

I think the solution i got was to set the display property to something else, but i'm not entirely sure.

Any suggestions?

like image 455
qwerty Avatar asked Sep 07 '11 16:09

qwerty


1 Answers

I believe you would have to have a container and set the container width to 200%. The two inside divs with 50% width will fit inside.

#container_div{ width:200%}
.inner_div {width:50%}
like image 149
Hammad Khan Avatar answered Sep 30 '22 13:09

Hammad Khan