針對IE6, IE7, Firefox的CSS

來源:互聯網
上載者:User

我們在用CSS進行構建網頁的時候,IE6跟Firefox之間的差異問題可以用 !important 來解決(這種方法盡量少用),但是IE7似乎還是不認識 !important ,而且它跟IE6之間也存在一些差異。瀏覽器的不一致性總是讓人很頭疼!

下面分別給出IE6\IE7\Firefox的hack代碼:

#example { color: #333; }     /* Firefox */* html #example { color: #666; }     /* IE6 */*+html #example { color: #999; }     /* IE7 */

那麼在Firefox下字型顏色顯示為#333,IE6下字型顏色顯示為#666,IE7下字型顏色顯示為#999,他們之間互不干擾。

相關文章

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.