Home arrow Style Sheets arrow Page 4 - Changing Grid Units in the Blueprint CSS Framework
STYLE SHEETS

Changing Grid Units in the Blueprint CSS Framework


Among the dozens of CSS frameworks available these days on the web, there’s one that stands out from the rest due to its impressive features and flat learning curve. In this particular case, I’m speaking of Blueprint CSS, a robust CSS library created over the last year by Oval Frihagen Bjørkøy that permits you to build all sorts of clever web page layouts by using a clean, grid-based approach.

Author Info:
By: Alejandro Gervasio
Rating: 5 stars5 stars5 stars5 stars5 stars / 1
May 14, 2009
TABLE OF CONTENTS:
  1. · Changing Grid Units in the Blueprint CSS Framework
  2. · Review: constructing a three-column design with Blueprint CSS
  3. · Building a two-column web page layout
  4. · Completing the web page layout

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
Changing Grid Units in the Blueprint CSS Framework - Completing the web page layout
(Page 4 of 4 )

As you might guess, turning the raw (X)HTML file defined in the previous segment into a two-column web page layout is reduced to attaching the source files of Blueprint CSS to the corresponding markup and nothing else.

The below code sample demonstrates how to accomplish this. Have a look at it, please:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<title>2-column web page layout</title>

<!-- framework CSS source files-->

<link rel="stylesheet" href="blueprint/screen.css" type="text/css" media="screen, projection" />

<link rel="stylesheet" href="blueprint/print.css" type="text/css" media="print" />

<!--[if IE]><link rel="stylesheet" href="blueprint/ie.css" type="text/css" media="screen, projection" /><![endif]-->

</head>

<body>

<div class="container showgrid">

<div class="span-24">

<h1>2-column layout</h1>

<h2>This section spans 24 cols</h2>

<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>

</div>

<div class="span-16">

<h2>This section spans 16 cols</h2>

<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>

<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>

</div>

<div class="span-8 last">

<h2>This section spans 8 cols</h2>

<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>

</div>

<div class="span-24">

<h2>This section spans 24 cols</h2>

<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>

</div>

</div>

</body>

</html>


Simple to code and read, right? Now, if you try out the above example on your own browser, you should get an output similar to the following:



For the sake of clarity, I decided to keep the background grid visible, but naturally it can be easily hidden from display by removing the “showgrid” CSS class from the main “container” div. Now, have fun by tweaking this class and the ones that span grid units to produce different sorts of web page layouts. I used to do this when I’ve had problems sleeping, and it works like a charm.

Final thoughts

In this second part of the series, I went through the development of a two-column web page layout using the Blueprint CSS framework. Indeed, this process is extremely straightforward, meaning that you shouldn’t have major problems if you ever want to implement it when building your own web sites.

In the forthcoming article, I’ll be discussing the use of “append-x” CSS classes with Blueprint CSS. Now that you’ve been warned about the topics that will be covered in the next tutorial, you won’t want to miss it!


DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

blog comments powered by Disqus
STYLE SHEETS ARTICLES

- CSS Combinators: Working with Child Combinat...
- CSS Combinators: Using General Siblings
- Intro to CSS Combinators
- CSS Semicircles and Web Page Headers
- Drawing Circular Shapes with CSS3 and Border...
- More CSS Pagination Link Templates
- CSS Pagination Links
- Animated CSS3 Image Gallery: Advanced Transi...
- CSS3 Animated Image Gallery: Transitions
- CSS3 Properties: Fixed Heights with box-sizi...
- CSS3 Properties: Altering Strokes and 3D Eff...
- CSS3 Properties: Text-Stroke
- CSS3 Transitions: Width and Height Properties
- Creating a Drop Down Menu in CSS3
- Intro to CSS Transitions

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 10 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials