国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > CSS > 正文

CSS重置(CSS Reset) 讓網頁樣式在各瀏覽器中表現一致

2024-07-11 08:36:36
字體:
來源:轉載
供稿:網友

CSS Reset是指重設瀏覽器的樣式。在各種瀏覽器中,都會對CSS的選擇器默認一些數值,譬如當h1沒有被設置數值時,顯示一定大小。但并不是所有的瀏覽器都使用一樣的數值,所以有了CSS Reset,以讓網頁的樣式在各瀏覽器中表現一致。

下面介紹幾個主流的CSS Reset代碼
1、Eric Meyer


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, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: ”;
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}

2、YUI


/*
YUI 3.4.1 (build 4118)
Copyright 2011 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
/*
TODO will need to remove settings on HTML since we can’t namespace it.
TODO with the prefix,should I group by selector or property for weight savings?
*/
html {
color:#000;
background:#FFF;
}
/*
TODO remove settings on BODY since we can’t namespace it.
*/
/*
TODO test putting a class on HEAD.
– Fails on FF.
*/
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td {
margin:0;
padding:0;
}
table {
border-collapse:collapse;
border-spacing:0;
}
fieldset,img {
border:0;
}
/*
TODO think about hanlding inheritence differently,maybe letting IE6 fail a bit…
*/
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;

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 松溪县| 钟山县| 柳河县| 惠东县| 阿鲁科尔沁旗| 神农架林区| 乌兰浩特市| 新泰市| 屏东市| 洪湖市| 横峰县| 色达县| 孟村| 同德县| 从江县| 阿鲁科尔沁旗| 舒城县| 南靖县| 乌恰县| 左权县| 玉门市| 乌苏市| 夏津县| 永德县| 丹寨县| 镇远县| 井研县| 时尚| 方城县| 临武县| 昔阳县| 大荔县| 新闻| 白山市| 黎川县| 夹江县| 乌鲁木齐县| 海伦市| 公主岭市| 湖北省| 镇沅|