重置样式

首先写一个项目的时候需要有一个重置全局的样式,为了弥补各种浏览器的展现不同

(1) 首先使用元素标签将每个元素的margin和padding的值改为0,让页面不会因浏览器默认设置不同而改变页边距和字边距;

(2) 设置<body>元素的字体颜色,字号大小等,可以规范整个项目网站的样式风格;

(3) 设置其他元素的特定样式;

 1 body,h1,h2,h3,h4,h5,h6,hr,p,blockquote,dl,dt,dd,ul,ol,li,pre,form,fieldset,legend,button,input,textarea,th,td{
 2     margin: 0;padding: 0;
 3 }
 4 body,button,input,select,textarea{
 5     font:12px/1.5 tahoma,arial,\5b8b\4f53;
 6 }
 7 h1,h2,h3,h4,h5,h6{
 8     font-size: 100%;
 9 }
10 address,cite,dfn,em,var{
11     font-style: normal;
12 }
13 code,kbd,pre,samp{
14     font-family: courier new,courier,monospace;
15 }
16 small{
17     font-size: 12px;
18 }
19 ul,ol{
20     list-style: none;
21 }
22 a{
23     text-decoration: none;
24 }
25 a:hover{
26     text-decoration: underline;
27 }
28 sup{
29     vertical-align: text-top;
30 }
31 sub{
32     vertical-align: text-bottom;
33 }
34 legend{
35     color:#000;
36 }
37 fieldset,img{
38     border: 0;
39 }
40 button,input,select,textarea{
41     font-size: 100%;
42 }
43 table{
44     border-collapse: collapse;//如果可能边框会合并为一个单一的边框。会忽略border-spacing和empty-cell属性
45 }
46 .clear{
47     clear: both;
48     float: none;
49     height: 0;
50     overflow: hidden;
51 }
52 html .hide{
53     display: none;
54 }

注释:

第五行

这是css中font的简写写法

字体: 字体大小/字体行高 字体格式

相当于

body,html,input
{
font: 12px;
line-height: 1.5;
font-family: tahoma,arial,\5b8b\4f53,sans-serif;  

//tahoma 大河马字体,window英文默认字形;

//arial 是一套随同多套微软应用软件所分发的无衬线体TrueType字

//sans-serif    表示是无衬线字体,是一种通用字体族。

//"\5b8b\4f53″ 就是 “宋体”。用 unicode 表示,不用 SimSun, 是因为 Firefox 的某些版本和 Opera 不支持 SimSun 的写法。注释乱码:强烈建议不要用中文注释。font-family:’宋体’
}

一些中文名字的unicode

新细明体 \65B0\7EC6\660E\4F53
细明体 \7EC6\660E\4F53
标楷体 \6807\6977\4F53
黑体 \9ED1\4F53
宋体 \5B8B\4F53
新宋体 \65B0\5B8B\4F53
仿宋 \4EFF\5B8B
楷体 \6977\4F53
仿宋_GB2312 \4EFF\5B8B_GB2312
楷体_GB2312 \6977\4F53_GB2312
微软正黑体 \5FAE\x8F6F\6B63\9ED1\4F53
微软雅黑 \5FAE\8F6F\96C5\9ED1

 

posted @ 2015-10-24 10:37  fnncat  阅读(133)  评论(0编辑  收藏  举报