來一波CSS相容問題小總結吧

來源:互聯網
上載者:User

標籤:for   表徵圖   transform   問題   瀏覽器   nbsp   idt   soft   需要   

1.DOCTYPE 影響 CSS 處理;

2.Firefox Google等瀏覽器 設定 padding 後, div 會增加 height 和 width, 但 IE 不會, 故需要用 !important 多設一個 height 和 width

3.Firefox Google等瀏覽器支援 !important, IE 則忽略, 可用 !important 為 FF 特別設定樣式

4.div 的垂直置中問題: vertical-align:middle; 將行距增加到和整個DIV一樣高 line-height:200px; 然後插入文字,就垂直置中了。缺點是要控制內容不要換行;

5.在mozilla firefox和IE中的BOX模型解釋不一致導致相差2px解決方案:div{margin:30px!important;margin:28px;}

6.ul和ol列表縮排問題 消除ul、ol等列表的縮排時,樣式應寫成:list-style:none;margin:0px;padding:0px;

7.CSS透明問題 IE下寫法:IE:filter:progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=60)。其他瀏覽器寫法:opacity:0.6;

8.CSS圓角問題IE7以下不支援圓角,其他瀏覽器需要加上自己的首碼;

9.給元素添加小手表徵圖時都是用:cursor:pointer;

10.字型大小small的定義不同,Google,Firefox等瀏覽器下的13px,在ie中為16px,差別較大,解決方案:使用指定的字型大小如14px;

 

來一波CSS相容問題小總結吧

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.