views:

314

answers:

1

Hi all,

I'm trying to figure out whether blueprint css framework is good fit for me, and i encountered the following snag along the way. The problem is that I have two pre each wrapped in a div with span-12 class, but they are not displaying side by side in two columns, one wrap around the other to the bottom for some reason. the following code demonstrating the problem should just work if you copy it into some html file:

<html>
<head>
    <link rel="stylesheet" href="http://github.com/joshuaclayton/blueprint-css/raw/63795c8bfe31cbbfad726f714bf8d22770adc7ad/blueprint/screen.css" type="text/css" media="screen, projection">
</head>
<body>
    <div class="container">
     <div class="span-24">
      <div class="span-12" style="background:#eee;"><pre>Hello world asdf asdf asdf asd fas df asd fas dfas dfasd f</pre></div>
      <div class="span-12" style="background:#ccc;"><pre>Hello world asdf asdf asdf asd fas df asd fas dfas dfasd f</pre></div>
     </div>
    </div>
</body>
</html>
+1  A: 

The reason your <div>s are wrapping has nothing to do with the <pre> tag.

Each of the <div>s have a width of 470px and a right margin of 10px. For the two, this is a total of 960px, which is 10px wider than your containing <div> (950px).

The solution here is to use the "last" class (provided by the Blueprint CSS framework) to the last <div>:

<div class="span-12" style="background:#eee;"><pre>Hello world asdf asdf asdf asd fas df asd fas dfas dfasd f</pre></div>
<div class="span-12 last" style="background:#ccc;"><pre>Hello world asdf asdf asdf asd fas df asd fas dfas dfasd f</pre></div>

This class removes the right margin and allows the <div>s to fit within their container.

You can see a demo of this here: http://demo.raleighbuckner.com/so/1353282/

81bronco