Accustomed to the background of our program, whether it is interested in the front-end programming, through the CSS framework, so that we can easily develop a page based on the DIV+CSS layout, today let us understand the next famous Blueprint CSS Framework bar!
Its official website: http://www.blueprintcss.org/
First you should declare a good CSS, which is very simple, by adding the following references in the head area of the page:
HTML code
- <link rel="stylesheet" href="css/blueprint/screen.css" type= "Text/css" media= "screen, projection">
- <link rel="stylesheet" href="css/blueprint/print.css" type= "Text/css" media= "Print">
- <!--[if LT IE 8]><link rel= "stylesheet" href= "Css/blueprint/ie.css" type= "text/css" media= "screen, projection "><! [endif]-->
Blueprint provides us with a variety of CSS files such as grid,form,print,reset,typography, and we focus on the next layout.
By default, 950px is the width, for example we can use the following code to represent the center div of the 950px:
HTML code
- <div class="container">
- Lt;p>here ' s my site! </P>
- </div>
You can use Span-x to define the column in the container, for example, we need to implement the common top, main area 3 column layout, which can take advantage of the following code:
HTML code
- <div class="container" style= "border:1px solid #000;" >
- <div class="span-24 last">
- Top of
- </div>
- <div class="span-4">
- Left sidebar
- </div>
- <div class="span-16">
- Subject
- </div>
- <div class="span-4 last">
- Right Sidebar
- </div>
- </div>
The Span-x naming convention is to specify the width, each span-x is 40px higher than the previous one and the starting value is 30px, which can be found in the Grid.css file as follows:
HTML code
- /* Use these classes to set the width of a column. */
- . span-1 {width:30px;}
- . span-2 {width:70px;}
- . span-3 {width:110px;}
- ......
- . span-23 {width:910px;}
- . span-24, div.span-24 {width:950px; margin-right:0;}
The definition of the column in the container is perhaps nested, such as the following code we have fixed a top, middle, top layout, in which part of the left, middle and right layout, the middle side includes the upper and lower layout, the code is as follows:
HTML code
- <div class="container">
- <div class="span-24 last">
- Header
- </div>
- <div class="span-4">
- Left sidebar
- </div>
- <div class="span-16">
- <div class="span-8">
- Box1
- </div>
- <div class="span-4">
- Box2
- </div>
- <div class="span-4 last">
- Box3
- </div>
- <div class="span-16 last">
- Main Content
- </div>
- </div>
- <div class="span-4 last">
- Right Sidebar
- </div>
- <div class="span-24 last">
- Footer
- </div>
- </div>
In all layouts, note that the definition of the last column within a container is appended to the previous one, to ensure that the sum of the values of the span-x defined in a row is more than 24, and you want to know more, you can download the blueprint frame package directly in the attachment with a complete and comprehensive example.
It feels like a good CSS framework for beginners.
- Joshuaclayton-blueprint-css-v0.9.1-0-g9be6857.zip (3.9 MB)
CSS Framework Blueprint