做惯了后台程序的我们,是否对前端编程有兴趣么,通过CSS框架,使我们很容易的开发出基于Div+CSS布局的页面来,今天让我们了解下大名鼎鼎的blueprint CSS框架吧!
它的官方网站:http://www.blueprintcss.org/
首先你应该申明好CSS,这很简单,通过在页面的head区域加入如下引用即可:
Html代码
blueprint为我们提供了grid,form,print,reset,typography等多种css文件,我们重点来了解下布局。
在默认情况下,以950px作为宽度,比如我们可以利用如下代码,表示950px的居中Div:
Html代码
你可以通过span-x来进行容器内列的定义,比如我们需要实现常见的顶部,main区域3列布局,可利用如下代码:
Html代码
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
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