我无法将下拉菜单中的项目居中。我已经尝试了这个网站上建议的很多东西,但似乎都没有。
这是我的CSS:
select {
-webkit-appearance: button;
-webkit-user-select: none;
-webkit-padding-start: 6px;
-webkit-padding-end: 6px;
background-color: #050505;
color: #ffffff;
border: 1px solid #ffffff;
box-shadow: 11px 10px 5px #000000;
text-shadow:4px 4px 10px #000000;
font-family: "UglyQua", Arial, Helvetica, sans-serif;
font-size: 20px;
font-weight: bold;
padding-top: 2px;
padding-bottom: 2px;
text-align: center;
white-space: nowrap;
}
..和我的HTML:
<!DOCTYPE html>
<html>
<head>
<script language="javascript" type="text/javascript">
function jump(form) {
var myindex=form.menu.selectedIndex
if (form.menu.options[myindex].value != "0")
{
window.open(form.menu.options[myindex].value,
target="iframe1");
}
}
//-->
</script>
</head>
<center>
<body>
<form name="lissamenu2" ACTION=URI>
<select name="menu" onchange="jump(this.form)">
<option value="0" selected>Select site:</option>
<option value="http://www.google.com/">Google</option>
<option value="http://www.youtube.com/">YouTube</option>
<option value="http://www.stackoverflow.com/">StackOverflow</option>
</select>
</form>
</center>
</body>
</html>