<分区>
<分区>
如何将css 样式添加到此表单的下拉列表中?我在互联网上搜索了很多,但没有找到有用的结果。 谢谢
echo "<form method='post' action='advisor.php?view=$view'>
Select Student: <select name='data'>";
while($row = mysqli_fetch_array($query))
{
echo "<option value=\"".$row[3] . "\">".$row[0] ." " . $row[1] . " (".$row[3].")".
"</option>";
}
echo " </select>
<input type='submit' name='submit' class='buttonM' value='Show Questions' />
</form>";
}
最佳答案
检查一下 - http://bavotasan.com/2011/style-select-box-using-only-css/
html
<div class="styled-select">
<select>
<option>Here is the first option</option>
<option>The second option</option>
</select>
</div>
CSS
.styled-select select {
background: transparent;
width: 268px;
padding: 5px;
font-size: 16px;
line-height: 1;
border: 0;
border-radius: 0;
height: 34px;
-webkit-appearance: none;
}
要获得更精细的样式,您需要使用 javascript - 像这样 http://tympanus.net/codrops/2012/10/04/custom-drop-down-list-styling/
关于php - 如何设置下拉列表的样式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17701093/