Home arrow Style Sheets arrow Page 3 - Pushing Web Page Columns with the Blueprint CSS Framework
STYLE SHEETS

Pushing Web Page Columns with the Blueprint CSS Framework


If you're looking for an appealing CSS framework that lets you build web pages using a grid-based approach, keep reading. This article is part of a series that shows you how to use the Blueprint CSS framework. In this part, you'll learn how to use a function that lets you shift one or more columns of a web document.

Author Info:
By: Alejandro Gervasio
Rating: 5 stars5 stars5 stars5 stars5 stars / 1
June 11, 2009
TABLE OF CONTENTS:
  1. · Pushing Web Page Columns with the Blueprint CSS Framework
  2. · Review: working with the prepend-x and append-x CSS classes
  3. · Introducing the generic push-x CSS classes
  4. · Adding the Blueprint CSS style sheets to the (X)HTML file

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
Pushing Web Page Columns with the Blueprint CSS Framework - Introducing the generic push-x CSS classes
(Page 3 of 4 )

As I expressed in the introduction, Blueprint CSS comes equipped with the “push-x” class that obviously permits users to push a selected web page element to the left. As with the “span-x,” “prepend-x” and “append-x” classes that you learned in previous articles, “push” classes work with grid units, which ensures that all of the pushed elements will be aligned on the pixel level with the background gird.

But undoubtedly, the best way to understand how “push-x” classes work actually is by means of a concrete code sample. With this in mind, below I recoded the (X)HTML file that you saw in the previous section, this time using these classes. Here’s how this file now looks:

<!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>Using push class</title>

</head>

<body>

<div class="container showgrid">

<div class="span-24">

<h1>Using push class</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-8">

<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-16 last">

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

<p class="push-1">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 class="push-2">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 class="push-3">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>


See how simple it is to work with “push-x” CSS classes with Blueprint CSS? I guess you do! However, take some time to analyze more closely the markup of the above (X)HTML file. It uses the classes in question to set three different levels of indentation for some paragraphs.

Quite possibly, the previous code sample won’t show too clearly how the “push-x” classes really behave, so to dissipate any doubts that you might have, in the next few lines I included a complementary image that demonstrates how this web page layout is rendered on screen. Have a look at it, please:



As shown by the previous screen shot, the paragraphs have been neatly shifted to the left side of the web document, while sticking to the background grid the entire time. This makes the whole design flow very harmoniously across the web document.

Well, at this moment, you hopefully grasped the logic that drives the usage of “push-x” columns with Blueprint CSS. Thus, in the concluding segment of this article I’m going to complete the signature of the (X)HTML file defined earlier, by annexing to it the source files of the framework.

To see how this final process will be performed, please click on the link shown below and read the next few lines. We’re almost finished!


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 8 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials