Home >Web Front-end >HTML Tutorial >CSS frameworkBluePrint_html/css_WEB-ITnose

CSS frameworkBluePrint_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:51:271424browse

做惯了后台程序的我们,是否对前端编程有兴趣么,通过CSS框架,使我们很容易的开发出基于Div+CSS布局的页面来,今天让我们了解下大名鼎鼎的blueprint CSS框架吧!

 

它的官方网站:http://www.blueprintcss.org/

 

首先你应该申明好CSS,这很简单,通过在页面的head区域加入如下引用即可:

 

 

Html代码  

  1.   
  2.     
  3.   

 

blueprint为我们提供了grid,form,print,reset,typography等多种css文件,我们重点来了解下布局。

 

在默认情况下,以950px作为宽度,比如我们可以利用如下代码,表示950px的居中Div:

 

 

Html代码  

  1.   
  2. lt;p>Here's my site!

      
  

 

你可以通过span-x来进行容器内列的定义,比如我们需要实现常见的顶部,main区域3列布局,可利用如下代码:

 

 

Html代码  

  1.   
  2.     
      
  3.         顶部  
  4.     
  
  •     
      
  •         左侧边栏  
  •     
  •   
  •     
      
  •         主体  
  •     
  •   
  •     
      
  •         右侧边栏  
  •           
  • The naming rule of span-x is to specify the width. Each span-x is 40px higher than the previous one. The starting value is 30px. It can be found in the grid.css file as follows Definition:

    Html code

    1. /* Use these classes to set the width of a column. */
    2. .span-1 {width: 30px;}
    3. .span-2 {width: 70px;} 110px;} 
    4. ...... 
    5. .span-23 {width: 910px;} 
    6. .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 define a top and middle , top layout, where the middle part is divided into left, middle and right layouts, and the middle part includes upper and lower layouts. The code is as follows:

    Html code

    1. Header
  • Left sidebar
  • Box1
  • Box2
  •                                                                                         > ;
  • Main content
  • Right sidebar
  • Footer
  • In all layouts, please note: the last column in a container The definition should be added with last, and make sure that the sum of the span-x definitions in one line exceeds 24. If you want to know more, you can directly download the blueprint framework package in the attachment, which comes with a complete and comprehensive example.
  • It feels like a good CSS framework for novices.
  • joshuaclayton-blueprint-css-v0.9.1-0-g9be6857.zip (3.9 MB)
  • Statement:
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
    Previous article:How to transfer values ​​between pages_html/css_WEB-ITnoseNext article:How to transfer values ​​between pages_html/css_WEB-ITnose

    Related articles

    See more