2012-01-18 114 views
0

我爲HTML下拉元素編寫了一種樣式,它在FF和Safari上效果極佳,但不適用於Chrome和IE。CSS for Dropdown在Chrome和IE中無法正常工作

這裏我連着形象和風格代碼:

enter image description here

.select_box { 
    background-color: transparent; 
    background-image: url(images/input_smal.png); 
    background-repeat: no-repeat; 
    border: none; 
    color: #FFFFFF; 
    font-family: Verdana, Arial, Helvetica, sans-serif; 
    font-size: 14px; 
    height: 33px; 
    padding: 6px 15px 5px; 
    width: 292px; 
} 

HTML代碼:

<!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>Muhammad Sajid</title> 
<link href="style.css" rel="stylesheet" type="text/css" /> 
</head> 
<body> 
    <table width="100%" border="0" align="left" cellpadding="0" cellspacing="15"> 
     <tr> 
      <td nowrap="nowrap">Status</td> 
      <td><select class="select_box" id="status" name="status"> 
        <option >Open</option> 
        <option >Pending</option> 
        <option >In Progress</option> 
        <option selected="selected">Closed</option> 
       </select> 
      </td> 
     </tr> 
    </table> 
</body> 
</html> 

我相信,由於該問題引起來: 背景顏色和或背景圖屬性,但我無法修復它們....!

+0

請推你的HTML代碼 – sandeep 2012-01-18 08:00:40

+0

好吧我粘貼HTML代碼以及 – 2012-01-18 08:09:11

+0

wated字節可以這樣寫:'background:transparent url(images/input_smal.png)no-repeat 0 0;'我不知道它是否它解決了你的問題,但我通常在使用背景圖像時留下顏色'background:url(images/input_smal.png)no-repeat 0 0;' – Dementic 2012-01-18 08:58:22

回答

0

我認爲您在Google Chrome中遇到的問題與版本2.0中的錯誤有關,但它已在3.0中解決。在這裏,您對此有鏈接話題的錯誤:

Why is the html select background-color black in Chrome when set to transparent?

關於IE瀏覽器,您使用的是IE 7或更低?如果是這樣,他們不支持transparent背景。您應該將特定的背景顏色專門應用於IE7和更低版本(例如,使用黑客)。

+0

我正在使用Chrome:16.0.912.75 m – 2012-01-18 09:02:00

+0

我已經修復了IE – 2012-01-18 09:02:50

相關問題