Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS: Preventing one div from wrapping beneath another

Tags:

html

css

How do I prevent one div from wrapping beneath another? Specifically, I want the 2nd div to always be to the right of the 1st div, even if the browser width is resized such that the 2nd div's contents must wrap.

I always want the divs to be side by side: I want this the divs to always be side by side

and to never look like this, even if the browser window is resized such that the 2nd div's contents must wrap:
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>
like image 777
Chris Han Avatar asked Feb 25 '13 07:02

Chris Han


1 Answers

<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>

An example: http://jsfiddle.net/arPzt/

like image 110
MarcinJuraszek Avatar answered Sep 17 '22 21:09

MarcinJuraszek