2013-01-21 81 views
0

我有一个像this结构。我面临的问题是: 当屏幕的x轴小于y轴时,按钮工具栏(黑色)跳转到屏幕顶部。如果x轴更小,我的字段集会垂直地从botton工具栏中跳出。如何解决这个问题并使现场组保持其位置? 我试过使用overflow,但没有成功。使浮动元素保持其位置

+0

我不明白你试图理解?你想要黑色和红色的屏幕,因为它总是当屏幕变大或变小时?让我知道? –

回答

0

不要使用float:left

设置.dhFieldset元素是display:inline-block;,然后设置其容器.dhButtonToolbarwhite-space:nowrap;

@media screen and (max-aspect-ratio: 1/1) { 
    .dhFieldset{ 
     display:inline-block; /*Added this line and remove the float:left*/ 
     height:37px; 
     width:auto; 
    } 
} 

@media screen and (max-aspect-ratio: 1/1) { 
    .dhButtonToolbar { 
     height: 60px; 
     left:5px; 
     width:100%; 
     right: 5px; 
     white-space:nowrap; /*added this line*/ 
    } 
} 

演示在http://jsfiddle.net/gaby/Ueaa9/4/