2013-02-25 2 views
6

한 div가 다른 div 아래에 줄 바꿈하지 않게하려면 어떻게해야합니까? 특히, 두 번째 div의 내용을 줄 바꿈해야 브라우저 너비의 크기를 조정하더라도 두 번째 div가 항상 첫 번째 div의 오른쪽에 있도록하고 싶습니다.CSS : 한 div가 다른 div 아래에 줄 바꿈하는 것을 방지합니다.

나는 항상 div를 나란히 할 것을 권장합니다 I want this the divs to always be side by side

브라우저 창 2 DIV의 내용을 포장해야한다는 등의 크기를 조정할 경우에도 다음과 같이 결코 :
And never have the 2nd div wrap beneath the first div

<!DOCTYPE html> 
<html lang="en"> 
    <body> 
    <div class="columns"> 
     <div style="background-color: #990000; width:70px; float: left"> 
     Pic 
     </div> 
     <div style="background-color: #00FF00; float: left; " > 
     body some interesting large amount of content. some interesting large amount of content. 
     </div>  
    </div> 
    </body> 
</html> 

답변

5
<div class="columns"> 
    <div style="background-color: #990000; width:70px; float: left"> 
     Pic 
    </div> 
    <div style="background-color: #00FF00; margin-left: 70px;" > 
     body some interesting large amount of content. some interesting large amount of content. 
    </div>  
</div> 

예 : http://jsfiddle.net/arPzt/

+0

적합합니다. 감사! –

관련 문제