我想编辑一个选择框,但箭头不会改变,我确实在我的页面中包含了font-awesome。
#editDocent{
background-color: white;
border: 0;
-webkit-appearance: none;
-moz-appearance: none;
}
#editDocent:after{
content: "\f063";
font-family: FontAwesome;
}
<link rel="stylesheet" type="text/css" href="../css/font-awesome.min.css">
<select id="editDocent">
<?php
$docentenQuery = mysqli_query($con, "SELECT * FROM users WHERE is_docent = '1'");
$docentenNumRows = mysqli_num_rows($docentenQuery);
$docentenResult = mysqli_fetch_assoc($docentenQuery);
foreach ($docentenQuery as $data) {
if ($data['id'] == $result2['id']) {
echo "<option data-id='" . $data['id'] . "' selected>" . $data["voornaam"] . " " . $data["achternaam"] . "</option>";
} else {
echo "<option data-id='" . $data['id'] . "'>" . $data["voornaam"] . " " . $data["achternaam"] . "</option>";
}
}
?>
</select>
答案 0 :(得分:0)
你不能在html选择元素之前和之后使用,就是这样!
#editDocent{
background-color: white;
border: 0;
-webkit-appearance: none;
-moz-appearance: none;
}
#editDocent:after{
content: "\f063";
font-family: FontAwesome;
}
<div id="editDocent">
<select>
<?php
$docentenQuery = mysqli_query($con, "SELECT * FROM users WHERE is_docent = '1'");
$docentenNumRows = mysqli_num_rows($docentenQuery);
$docentenResult = mysqli_fetch_assoc($docentenQuery);
foreach ($docentenQuery as $data) {
if ($data['id'] == $result2['id']) {
echo "<option data-id='" . $data['id'] . "' selected>" . $data["voornaam"] . " " . $data["achternaam"] . "</option>";
} else {
echo "<option data-id='" . $data['id'] . "'>" . $data["voornaam"] . " " . $data["achternaam"] . "</option>";
}
}
?>
</select>
</div>