關於CSS reset,CSSreset

來源:互聯網
上載者:User

關於CSS reset,CSSreset

關於CSS reset
CSS reset(css重設)基本上是不需要的,至少可以說80%的的CSS reset都是沒有必要的,反而增加了頁面CSS 的overwrite,尤其像開心網*{margin:0;}這樣子業餘的做法更是要不得(反而破壞了很多UI的相容性,比如說單複選框等)。我不是一概鄙棄CSS reset,有些常用標籤我也是會簡單重設一下的,而且會避免overwrite(樣式重寫),以保證樣式最精簡,渲染最高效。如下程式碼範例:

body{ line-height:1.4; color:#333; font-family:arial; font-size: 12px; background:white;}input,textarea,select{ font-size:100%; font-family:inherit;}body,h1,h2,h3,h4,h5,h6,p,ul,ol,form{ margin:0;}h4,h5,h6{ font-size:1em;}ul,ol{ padding-left:0; list-style-type:none;}img{border:0;}

摘自 http://www.zhangxinxu.com/wordpress/2010/07/%e6%88%91%e6%98%af%e5%a6%82%e4%bd%95%e5%af%b9%e7%bd%91%e7%ab%99css%e8%bf%9b%e8%a1%8c%e6%9e%b6%e6%9e%84%e7%9a%84/

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.