您的位置:首页 > Web前端 > CSS

css重置浏览器字体大小示例分享

2014-01-14 14:38 405 查看
如果你不想下载9MB的文件,代码如下:
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p, 
blockquote,th,td {margin:0; padding:0; } 
table { border-collapse:collapse; border-spacing:0; } 
fieldset,img { border:0; } 
address,caption,cite,code,dfn,em,strong,th,var { font-style:normal; font-weight:normal; } 
ol,ul { list-style:none; } 
caption,th { text-align:left; } 
h1,h2,h3,h4,h5,h6 { font-size:100%; font-weight:normal; } 
q:before,q:after { content:”; } 
abbr,acronym { border:0; }


其次,我们重设浏览器字体的大小为10像素,使用如下:

html {font-size: 62.5%;}

这个大小基本合适,然后您可以根据自己的需要调整大小,如 标题1为120像素:
h1 {font-size: 2em;}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: