2013-06-30 152 views
0

我有一個<div>wrapper其中包含另外<div> s稱爲textboxcheckboxCss浮動權問題

我想能夠使黃色框進入包裝。 粉紅色框用作輸入文本字段,黃色框用作複選框。

Here the jsfiddle

我用盡了一切我能想到的諸如float: right但它只是推外

enter image description here的黃色方框

<html> 
<head> 
<title>Page</title> 
<script type="text/javascript" src="jquery-1.9.1.min.js"></script> 
<style type="text/css"> 
.box { 
    background-color: #008DEF; 
    color: #9C5A3C; 
    height:100px; 
    width:260px; 
    position: relative; top:70px; 
} 
.textbox 
{ 
    background-color: #FF58C3; 
    height:90px; 
    width:170px; 
} 
.checkbox 
{ 
    background-color: #FFAB24; 
    height:50px; 
    width:50px; 
    float:right; 
} 
</style> 
<div class="box"> 
<div class="textbox"> </div> 
<div class="checkbox"> </div> 
</div> 


</div> 




</body> 
</html> 

回答

4

嘗試增加float:left到.textbox類

FIDDLE

+0

對不起,我說,這是錯的。我腦海裏有太多東西,瘋狂地謝謝你,丹菲爾 –