我爲HTML下拉元素編寫了一種樣式,它在FF和Safari上效果極佳,但不適用於Chrome和IE。CSS for Dropdown在Chrome和IE中無法正常工作
這裏我連着形象和風格代碼:
.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>
我相信,由於該問題引起來: 背景顏色和或背景圖屬性,但我無法修復它們....!
請推你的HTML代碼 – sandeep 2012-01-18 08:00:40
好吧我粘貼HTML代碼以及 – 2012-01-18 08:09:11
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