關於css hack在不同瀏覽器下的區別

來源:互聯網
上載者:User

這個例子就可以說明 IE6 IE7 IE8 FireFox在css下的區別.通過不同代碼的區別,可以讓網站得到不同的相容,呵呵~~~~

Code

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CSS hack</title>
<style type="text/css">
.color{
 background-color: #CC00FF;  /*所有瀏覽器都會顯示為紫色*/
 background-color: #FF0000\9; /*IE6、IE7、IE8會顯示紅色*//
 *background-color: #0066FF;  /*IE6、IE7會變為藍色*/   
 _background-color: #009933;  /*IE6會變為綠色*

}
-->
</style>
</head>

<body>
<div id="test" class="color">csscsss</div>
<div id="note">
 <strong style="color:#009933">IE6</strong>
 <strong style="color:#0066FF">IE7</strong>
 <strong style="color:#FF0000">IE8</strong>
 <strong style="color:#CC00FF">FireFox</strong>
</div>
</body>
</html>

 

相關文章

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.