代码笔记

两种网页css重置代码Eric Meyer Reset CSS/YUI reset css

阅读

之前我曾经提到过写出更好的网页CSS代码的一些经验,其中第一项就是Reset CSS重置代码;

重置代码通常有两种说法,一种是Eric Meyer Reset CSS,另一种就是YUI reset css

关于这两种写法的来源,我在网上仔细找了找,只发现这篇博文还算有用

链接地址:http://www.52css.com/article.asp?id=1145

下面是第一种Eric Meyer Reset CSS

  kbd, q, s, samp, small, strike, strong, sub, sup, tt, var,     
h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr,     
acronym, address, big, cite, code, dl, dt, dd, ol, ul, li,     
fieldset, form, label, legend {     
    vertical-align: baselinebaseline;     
    font-family: inherit;     
    font-weight: inherit;     
    font-style: inherit;     
    font-size: 100%;     
    outline: 0;     
    padding: 0;     
    margin: 0;     
    border: 0;     
}     
:focus {     
    outline: 0;     
}     
body {     
    background: white;     
    line-height: 1;     
    color: black;     
}     
ol, ul {     
    list-style: none;     
}     
table {     
    border-collapse: separate;     
    border-spacing: 0;     
}     
caption, th, td {     
    font-weight: normal;     
    text-align: left;     
}     
blockquote:before, blockquote:after, q:before, q:after {     
    content: "";     
}     
blockquote, q {     
    quotes: "" "";     
}

 

下面是第二种YUI reset css

  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;
}
address, caption, cite, code, dfn, em, strong, th, var {
font-style:normal;
font-weight:normal;
}
li {
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;
font-variant:normal;
}

sup {
vertical-align:text-top;
}
sub {
vertical-align:text-bottom;
}
input, textarea, select {
font-family:inherit;
font-size:inherit;
font-weight:inherit;
}


  • 共2页:
  • 上一页
  • 1
  • 2
  • 下一页

  • 推荐阅读

    解决IE8及以下版本不支持
    解决IE8及以下版本不支...
    关于position的fixed属性失
    关于position的fixed属性失...
    用CSS3的rem设置字体大小
    用CSS3的rem设置字体大小...
    jscss让文本框输入法
    js&css让文本框输入法...
    Copyright 2006-2016 © okjn.cn. All Rights Reserved