自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

CSS中區(qū)分IE6,IE7,F(xiàn)irefox瀏覽器的方法

開發(fā) 前端
IE6,IE7,F(xiàn)irefox等瀏覽器都有各自的特點,而且支持不同的功能,那么如何區(qū)分它們呢,本文和大家分享一下CSS在IE6,IE7,F(xiàn)irefox瀏覽器中區(qū)分的方法。

本文和大家重點討論一下CSS在IE6,IE7,F(xiàn)irefox瀏覽器中區(qū)分的幾種方法,相信本文介紹一定會讓你有所收獲,歡迎大家一起來學習。

CSS在IE6,IE7,F(xiàn)irefox瀏覽器中區(qū)分的方法

◆區(qū)別IE6與Firefox:
background:orange;*background:blue;

◆區(qū)別IE6與IE7:
background:green!important;background:blue;

◆區(qū)別IE7與Firefox:
background:orange;*background:green;

◆區(qū)別Firefox,IE7,IE6:
background:orange;*background:green!important;*background:blue;

注:IE都能識別*;標準瀏覽器(如Firefox)不能識別*;

IE6能識別*,但不能識別!important,

IE7能識別*,也能識別!important;

Firefox不能識別*,但能識別!important;

                    IE6     IE7     Firefox
          *           √         √          ×
 !important      ×        √         √

◆另外再補充一個,下劃線"_",
IE6支持下劃線,IE7和firefox均不支持下劃線。

于是大家還可以這樣來區(qū)分IE6,IE7,F(xiàn)irefox
:background:orange;*background:green;_background:blue;

注:不管是什么方法,書寫的順序都是Firefox的寫在前面,IE7的寫在中間,IE6的寫在***面。

◆代碼示例:

  1. .p_redirect{  
  2. background-color:#FirefoxFirefoxFirefox;  
  3. border:1pxsolid#A3C2E0;  
  4. margin-right:1px;  
  5. font-size:12px!important;  
  6. font-size:13px;  
  7. }  
  8.  

是為了兼容IE/Firefox
font-size:12px!important;
font-size:13px;
在IE里面,由于IE不理解!important,則字體大小按照***設定的13px展示
而Firefox里面,!important為提高優(yōu)先級別,則字體大小按照!important標記的12px展示

文章來源:Div-Css.net設計網(wǎng)參考:http://www.div-css.net/div_css/topic/index.asp?id=7617

【編輯推薦】

  1. IE8與IE7實現(xiàn)共存的兩種方法揭秘
  2. DIV層在IE6下被下拉框遮擋的解決方法
  3. JavaScript巧解IE6至IE8兼容問題
  4. 深入探究IE8和IE7的24個區(qū)別
  5. CSS中輕松實現(xiàn)Firefox與IE透明度
責任編輯:佚名 來源: div-css.net
相關(guān)推薦

2010-08-27 14:43:15

IE6IE7Firefox

2010-09-06 15:06:29

IE6IE7Firefox

2010-08-18 15:22:28

IE6IE7Firefox

2010-08-18 14:21:48

FirefoxIE7IE6

2010-08-27 15:38:21

兼容IE6IE7

2010-08-20 08:45:55

IE6IE7IE8

2010-08-18 15:57:14

IE6IE7IE8

2010-09-16 13:17:31

IE6IE7IE8

2010-09-15 10:57:25

IE6IE7FF

2010-08-18 14:54:32

IE6IE7Firefox

2010-08-18 14:42:16

IE6IE7IE8

2010-08-17 16:27:52

IE6IE7IE8

2010-08-20 12:45:41

IE6IE7Firefox

2010-08-27 15:44:47

2010-08-20 09:25:11

IE6IE7IE8

2010-08-17 15:07:48

IE6IE7IE8

2010-08-27 15:08:10

FirefoxIE6IE7

2010-08-20 13:08:41

IE6IE7IE8

2010-08-24 09:46:57

IE6IE7FF火狐

2010-09-15 11:32:37

IE6IE7瀏覽器兼容性
點贊
收藏

51CTO技術(shù)棧公眾號