CSS framework BluePrint and cssblueprint

Source: Internet
Author: User

CSS framework BluePrint and cssblueprint

If we are used to background programs, are we interested in front-end programming? Through the CSS framework, we can easily develop pages based on Div + CSS layout, let's take a look at the famous blueprint CSS framework today!

 

Its official website: http://www.blueprintcss.org/

 

First, you should declare CSS, which is very simple. Add the following reference to the header area of the page:

 

 

Html code
  1. <Link rel = "stylesheet" href = "css/blueprint/screen.css" type = "text/css" media = "screen, projection">
  2. <Link rel = "stylesheet" href = "css/blueprint/print.css" type = "text/css" media = "print">
  3. <! -- [If lt IE 8]> <link rel = "stylesheet" href = "css/blueprint/ie.css" type = "text/css" media = "screen, projection "> <! [Endif] -->

 

Blueprint provides a variety of css files, such as grid, form, print, reset, and typography. We will focus on the layout.

 

By default, the width is 950px. For example, we can use the following code to indicate the center Div of 950px:

 

 

Html code
  1. <Div class = "container">
  2. Lt; p> Here's my site! </P>
  3. </Div>

 

You can use span-x to define the columns in the container. For example, you need to implement a common top-level layout with three columns in the main area. You can use the following code:

 

 

Html code
  1. <Div class = "container" style = "border: 1px solid #000;">
  2. <Div class = "span-24 last">
  3. Top
  4. </Div>
  5. <Div class = "span-4">
  6. Left sidebar
  7. </Div>
  8. <Div class = "span-16">
  9. Subject
  10. </Div>
  11. <Div class = "span-4 last">
  12. Right sidebar
  13. </Div>
  14. </Div>

The naming rule of span-xdefines the width. Each span-xis increased by 40 pxcompared to the previous one, and the start value is 30px. the following definitions can be found in the grid.css file:

 

 

Html code
  1. /* Use these classes to set the width of a column .*/
  2. . Span-1 {width: 30px ;}
  3. . Span-2 {width: 70px ;}
  4. . Span-3 {width: 110px ;}
  5. ......
  6. . Span-23 {width: 910px ;}
  7. . Span-24, div. span-24 {width: 950px; margin-right: 0 ;}

 

The definition of columns in the container may be nested. For example, in the following code, we have set a top, middle, and top layout. The center is divided into the left, middle, and right layout, the middle side includes the up and down layout. The Code is as follows:

 

 

Html code
  1. <Div class = "container">
  2. <Div class = "span-24 last">
  3. Header
  4. </Div>
  5. <Div class = "span-4">
  6. Left sidebar
  7. </Div>
  8. <Div class = "span-16">
  9. <Div class = "span-8">
  10. Box1
  11. </Div>
  12. <Div class = "span-4">
  13. Box2
  14. </Div>
  15. <Div class = "span-4 last">
  16. Box3
  17. </Div>
  18. <Div class = "span-16 last">
  19. Main content
  20. </Div>
  21. </Div>
  22. <Div class = "span-4 last">
  23. Right sidebar
  24. </Div>
  25. <Div class = "span-24 last">
  26. Footer
  27. </Div>
  28. </Div>
 

In all la S, note that the last column of the definition in a container must be added with last. Make sure that the total number of span-x defined values in a row exceeds 24, to learn more, you can directly download the blueprint framework package in the attachment, which contains a complete and comprehensive example.

 

It seems like a good CSS framework for beginners.

 

  • Joshuaclayton-blueprint-css-v0.9.1-0-g9be6857.zip (3.9 MB)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.