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

首頁(yè) > 開發(fā) > CSS > 正文

CSS重置(CSS Reset) 讓網(wǎng)頁(yè)樣式在各瀏覽器中表現(xiàn)一致

2024-07-11 08:34:10
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友

CSS Reset是指重設(shè)瀏覽器的樣式。在各種瀏覽器中,都會(huì)對(duì)CSS的選擇器默認(rèn)一些數(shù)值,譬如當(dāng)h1沒有被設(shè)置數(shù)值時(shí),顯示一定大小。但并不是所有的瀏覽器都使用一樣的數(shù)值,所以有了CSS Reset,以讓網(wǎng)頁(yè)的樣式在各瀏覽器中表現(xiàn)一致。

下面介紹幾個(gè)主流的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;

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 宁波市| 永春县| 新安县| 西和县| 金平| 新郑市| 昭觉县| 沾益县| 萝北县| 襄城县| 那坡县| 古田县| 谷城县| 平和县| 县级市| 咸宁市| 商都县| 治多县| 靖宇县| 灵宝市| 长子县| 黄大仙区| 西藏| 信阳市| 嘉鱼县| 巴楚县| 吉安市| 友谊县| 梁河县| 安化县| 大荔县| 安乡县| 安乡县| 体育| 建阳市| 樟树市| 六盘水市| 临海市| 四川省| 宜州市| 亳州市|