Stacking sections side by side in CSS

I did not want to resort to asking here, but after several hours of disappointment, I feel that I have to!

I have two (maybe more) divs that I want side by side. Their parent div has a fixed width and overflow:hidden, therefore, we can see no more than one div at a time. The problem is that they will not stack side by side! I tried float:leftand to display:inlineno avail.

there is a jsfiddle example i made here

Any help would be greatly appreciated!

+3
source share
6 answers

You will need a div

#tab_container{
    width:2000px;
}

, , .

http://jsfiddle.net/QBhmF/10/

+1

divs display:inline-block, : white-space:nowrap, .

:

http://jsfiddle.net/QBhmF/15/

+2

:

+1

: :

+1
0

Ioff ) :

<div class = 'container'>

<div class = 'floater'>Some text</div>
<div class = 'floater'>Some other text</div>

<div class = 'clearout'></div>

</div>

div.container {

width: 400px;
border: 1px solid blue;

}

div.floater {

float: left; 
width: 48%;
border: 1px solid red;
margin: 2px;

}

div.clearout {

clear: both; 
height: 0px; 
visibility: hidden; 
width: 100%;

}

, , . , , .

NTN

WITH

0
source

Source: https://habr.com/ru/post/1779383/


All Articles