转载:CSS Framework,让你事半功倍

2010-06-02 17:04:16 by 【6yang】, 140 visits, 收藏 | 返回
 

近两年来,程序员有一句话很流行,“不要重复制造轮子”,所以出现了许许多多让我们非常受用的各种框架。Framework在开发的各个领域给我们减少了很多工作量。而对于网页设计师来说,一直以来,缺少这样的Framework来帮助设计师们减轻工作量。

 今天给大家推荐一些不错的CSS Framework:

首先是本文的主角:

logo1.png

这是一个非常轻量级而且很少侵入性的框架(这话怎么看都不是网页设计师能熟悉的,:-) ),换句话来说,这是一个很底层的CSS Framework,并没有替你实现任何布局,也没有提供很多好看的模板。它只是帮你把一些最基本的事情做掉了,剩下的交给自己来了。非常适合那些具有一 定开发经验的网页设计师使用。我做了一些中文化修改,大家如果发现问题,可以联系我。

reset.css

html, body, div, span,applet,

object, iframe,h1, h2, h3, h4, h5, h6,

p, blockquote, pre,a, abbr, acronym,

address, big, cite, code,del, dfn, em,

font, img, ins, kbd, q, s, samp,small, strike,

strong, sub, sup, tt, var,dd, dl, dt,

li, ol, ul,fieldset, form, label, legend,

table, caption, tbody, tfoot, thead,

tr, th, td {

  margin: 0;padding: 0;border: 0;

  font-weight: inherit;font-style: inherit;

  font-size: 100%;line-height: 1;

  font-family: inherit;

  text-align: left;vertical-align: baseline;

}

a img, :link img, :visited img {border: 0;}

table {border-collapse: collapse;border-spacing: 0;}

ol, ul {list-style: none;}

q:before, q:after,blockquote:before, blockquote:after {content: “”;}

首先是将绝大部分元素的样式清零,免得经常会遇到各种各样的问题。来自于Eric 的一篇文章

 global.css

body{background-color:#FFFFFF;}

body, p, td, th, li

{

 font-family: “宋体”,verdana,helvetica,sans-serif;

 font-size:0.875em;

 line-height:1.5em;

 color:#000000;

}

注意两点,这里定义了背景色和前景色,这是标准要求的,是网页可用性的一个基本方面,大家可以执行修改。

第二点,就是font-size的问题,为了让网页更好的支持网页缩放功能,应该使用em来替换px,这样会让ie6等上古浏览器也能良好的支持网 页缩放。浏览器的默认字体高都是16px,所以未经调整的浏览器在显示1em=16px。换算过来的话也就是说1px=0.0625em,也就是12px =0.75em, 10px=0.625em,通过1px=0.0625em大家可以在CSS编写时通过px转换成em。

  

/* Standard Definitions

—————————————-*/

.left {float:left;}

.right {float:right;}

.clearIt {clear:both;}

/* =10px */

.small {font-size:.625em;}

/* =14px */

.large {font-size:0.875em;}

/* =16px */

.larger {font-size:1em;}

.soft {color:#D3D3D3;}

.hide {display:none;}

p.last {margin-bottom:0px;}

提供了一些比较实用的预定义类。

print.css

感谢Hartija Css Print  Framework提供,这里面有个非常好的idea,我们来看一下,大大提高了打印效果:

/*hide various parts from the site

#header, #footer, #navigation, #rightSideBar, #leftSideBar

{display:none;}

*/

对于网页打印来说,我们更需要的是正文内容,这样可以将那些美丽的元素暂时藏掉。

打包下载:element_css_framework_modify.rar

//———————————————————————

下面介绍些其他出色的框架:

blueprint-300x70.png

y3.gif

eswat.gif

960.gif

更多请参看:http://webtecker.com/2008/04/17/list-of-css-frameworks/

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
	margin: 0;
	padding: 0;
	border: 0;
	outline: 0;
	font-weight: inherit;
	font-style: inherit;
	font-size: 100%;
	font-family: inherit;
	vertical-align: baseline;
}
/* remember to define focus styles! */
:focus {
	outline: 0;
}
body {
	line-height: 1;
	color: black;
	background: white;
}
ol, ul {
	list-style: none;
}
/* tables still need 'cellspacing="0"' in the markup */
table {
	border-collapse: separate;
	border-spacing: 0;
}
caption, th, td {
	text-align: left;
	font-weight: normal;
}
blockquote:before, blockquote:after,
q:before, q:after {
	content: "";
}
blockquote, q {
	quotes: "" "";
}
分享到:
share

    图片原图

    loading

    loading