2016-12-02 97 views
3

如何让这两个溢出?我尝试了几乎所有的东西,所以我不知道该从哪里出发。 div s标有绿色和橙色。 enter image description here保持div溢出

enter image description here

#stemplingerclass { 
 
    clear: both; 
 
    max-width: 100%; 
 

 
} 
 

 
#datoid 
 
{ 
 

 
    clear: both; 
 
    max-width: 100%; 
 
}
<div class="col-sm-10"> 
 
    <div class="col-md-3 col-sm-3 col-xs-10 text-center" style="background-color: green;" > 
 
     <div id="datoid"> 
 

 

 
     </div> 
 
     </div> 
 

 
     <div class="col-md-7 col-sm-7 col-xs-10" style="background-color: orange;"> 
 
     <div id="stemplingerclass"> 
 

 
     </div> 
 
     </div> 
 
    </div>

+0

你试过'overflow-y:hidden;'? 和btw你的代码片段doesent工作... – weinde

+1

更新你的代码在小提琴 –

+0

overflow-y:hidden;给我“相同”的结果,它只是使日历部分可滚动。 –

回答

1

只需添加display: flex;到容器这两个divs。 如果你想让孩子不要伸展,也可以将align-items: flex-start;添加到你的容器中。

0

#greenpart{ 
 
    display: inline-block; 
 
width:49%; 
 
    overflow: scroll; 
 
    } 
 

 
    #orangepart{ 
 
     display: inline-block; 
 

 
width:49%; 
 
    overflow: scroll; 
 

 
    }
<div id="greenpart" class="col-md-3 col-sm-3 col-xs-10 text-center" style="background-color: green;" > 
 
      <div id="datoid"> 
 

 
    test1 
 
      </div> 
 
      </div> 
 

 
      <div id="orangepart"class="col-md-7 col-sm-7 col-xs-10" style="background-color: orange;"> 
 
      <div id="stemplingerclass"> 
 
    test2 
 
      </div> 
 
      </div>

+0

没有工作,在对方下面显示了2列。 –

0

             
  
#datoid { 
 
    width: 50%; 
 
    height: 100px; 
 
    float: left; 
 
    background-color: inherit; 
 
    overflow: scroll; 
 
} 
 

 
#stemplingerclass { 
 
    width: 50%; 
 
    height: 100px; 
 
    float: right; 
 
    background-color: inherit; 
 
    overflow: scroll; 
 
}
<div class="col-sm-10"> 
 
     <div class="col-md-3 col-sm-3 col-xs-10 text-center" style="background-color: green;" > 
 
      <div id="datoid"> 
 

 

 
      </div> 
 
      </div> 
 

 
      <div class="col-md-7 col-sm-7 col-xs-10" style="background-color: orange;"> 
 
      <div id="stemplingerclass"> 
 

 
      </div> 
 
      </div> 
 
     </div>