网络编程
位置:首页>> 网络编程>> 网页设计>> 简化的CSS Reset — 常用CSS重设实例(2)

简化的CSS Reset — 常用CSS重设实例(2)

作者:ximicc 来源:ximicc博客 发布时间:2009-03-11 16:46:00 

标签:实例,样式,css,语义化,reset


浓缩实用型CSS Reset(重设)

 * {
       vertical-align: baseline;
       font-weight: inherit;
       font-family: inherit;
       font-style: inherit;
       font-size: 100%;
       outline: 0;
       padding: 0;
       margin: 0;
       border: 0;
}

该CSS重设方法出自Perishable Press,这是他常用的方法。

Poor Man 的 CSS Reset

 html, body {
       padding: 0;
       margin: 0;
}
html {
       font-size:1em;

body {
       font-size:100%;

a img, :link img, :visited img {
       border:0px;
}

这个重设方法将html和body下元素的padding和margin都设为0,并分别为html标签和body标签下的所有元素设置了初始的字体大小,最重要的是把有链接的图片的默认边框去掉了。

Siolon 的 Global CSS Reset

 

* {
    vertical-align: baseline;
    font-family: inherit;
    fo

nt-style: inherit;
    font-size: 100%;
    border: none;
    padding: 0;
    margin: 0;
}
body {
    padding: 5px;
}
h1, h2, h3, h4, h5, h6, p, pre, blockquote, form, ul, ol, dl {
    margin: 20px 0;
}
li, dd, blockquote {
    margin-left: 40px;
}
table {
    border-collapse: collapse;
    border-spacing: 0;
}

Shaun Inman 的 Global Reset 

body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, form, fieldset, input, p, blockquote, table, th, td, embed, object {
    padding: 0;
    margin: 0;
}
table {
    border-collapse: collapse;
    border-spacing: 0;
}
    fieldset, img, abbr {
    border: 0;
}
address, caption, cite, code, dfn, em,
h1, h2, h3, h4, h5, h6, strong, th, var {
    font-weight: normal;
    font-style: normal;
}
ul {
    list-style: none;
}
caption, th {
    text-align: left;
}
h1, h2, h3, h4, h5, h6 {
    font-size: 1.0em;
}
q:before, q:after {
    content: ”;
}
a, ins {
    text-decoration: none;
}
0
投稿

猜你喜欢

手机版 网络编程 asp之家 www.aspxhome.com