2012-10-20 56 views
-6

我想製作一個谷歌搜索框,並且我爲此設計了一個代碼。但我有一個問題,導致在IE瀏覽器上運行Firefox瀏覽器和其他瀏覽器的CSS ...所以我能做什麼?CSS不能在IE上工作

這是代碼:

Abulkas平板

 #outerContainer{ 
     width: 350px; 
     height: 60px; 
     border-radius: 10px; 
     box-shadow: 0 0 5px 1px #888; 
     display: block; 
     } 
     .buttonwithimg 
      { 
      background: url(google-g-logo-2012.png) no-repeat; 
      cursor:pointer; 
         border: none; 
      } 


     .googleButton{ 
     position: relative; 
     left: 5px; 

     width: 40px; 
     height:50px; 
     } 

     #srchBox{ 
     border-radius: 3px; 
     margin-left: 8px; 
     height: 50px; 
     width:200px; 
     margin-top: 5px; 
     } 
     .otherButton{ 
     width:43px; 
     height: 50px; 
     .background { width:150px; height:150px; padding:3px; background-image: 
url(andro-view-tools/Transform-galaxy-s2-to-galaxy-s3.jpg); border: 
1px solid black; /* Safari and Chrome */ 
-webkit-background-size: 190% 160%; 

/* Firefox */ 
-moz-background-size: 190% 160%; 

/* Internet Explorer */ 
-ms-background-size: 190% 160%; 

/* Opera */ 
-o-background-size: 190% 160%; 

/* CSS3 */ background-size: 190% 160%; } 
     } 

    </style> 
    <div class="background"> 
     &nbsp;<div id="outerContainer" style="width: 342px; height: 63px"> 
     &nbsp;&nbsp;<button class="buttonwithimg" style="width: 59px; height: 57px">; 
</button><input id="srchBox" type="search">  
<button>class="otherButton" style="width: 59px; height: 52px">Search</button> 
    </div> 
     </div> </body> </html> 
+0

IE不支持盒子陰影。與它一起生活或製作你自己的。 –

+5

什麼不工作?您可以在Chrome和IE中發佈該頁面的屏幕截圖進行比較嗎? –

+2

您試圖支持哪些版本的IE? – Spudley

回答

3

的box-shadow 「黑客」 的IE瀏覽器,可以發現here

0

IE不支持box-shadow

爲了解決這個問題,我建議您使用css3Pie

此外,我不認爲IE9需要一個前綴爲background-size,所以我不相信你需要-ms-background-size。不管任何前綴,IE8根本不支持background-size。如果你想在IE8中支持它,請試試這個jquery hack:https://github.com/louisremi/jquery.backgroundSize.js

順便說一句:一個很好的網站,以幫助計算出什麼功能被任何特定的瀏覽器支持,是CanIUse.com

希望有所幫助。