重設預設樣式 css reset第1/2頁_經驗交流

來源:互聯網
上載者:User
我在HTML下的預設樣式中講到,一些標籤元素在HTML下有一個預設屬性值,我們在寫css頁面的時候,為了避免在css中重複定義它們,我們需要重設預設樣式(css reset)。每個人的用法和寫法都不一樣。找到一篇關於css reset的調查文章, 可以看看國外使用css reset的比例調查。
這裡有一篇總結css reset比較全面的文章,列舉了多種css reset的寫法,可以看看。
譯文地址查看
原文地址查看
接下來我也查看了國內的兩個網站,用Firebug按F12看看他們的css reset怎麼寫的?
淘寶(www.taobao.com):
html {
overflow-x:auto;
overflow-y:scroll;
}
body, dl, dt, dd, ul, ol, li, pre, form, fieldset, input, p, blockquote, th, td {
font-weight:400;
margin:0;
padding:0;
}
h1, h2, h3, h4, h4, h5 {
margin:0;
padding:0;
}
body {
background-color:#FFFFFF;
color:#666666;
font-family:Helvetica,Arial,sans-serif;
font-size:12px;
padding:0 10px;
text-align:left;
}
select {
font-size:12px;
}
table {
border-collapse:collapse;
}
fieldset, img {
border:0 none;
}
fieldset {
margin:0;
padding:0;
}
fieldset p {
margin:0;
padding:0 0 0 8px;
}
legend {
display:none;
}
address, caption, em, strong, th, i {
font-style:normal;
font-weight:400;
}
table caption {
margin-left:-1px;
}
hr {
border-bottom:1px solid #FFFFFF;
border-top:1px solid #E4E4E4;
border-width:1px 0;
clear:both;
height:2px;
margin:5px 0;
overflow:hidden;
}
ol, ul {
list-style-image:none;
list-style-position:outside;
list-style-type:none;
}
caption, th {
text-align:left;
}
q:before, q:after, blockquote:before, blockquote:after {
content:"";
}
當前1/2頁  12下一頁閱讀全文
相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.