ie8兼容問題(二) select文字垂直居中問題
代碼如下:
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<style>
.container {
background: lightgray;
height: 100px;
border: 1px solid #ddd;
line-height: 100px;
}
input, select {
height: 40px;
line-height: 40px;
outline: none;
vertical-align: middle;
}
</style>
</head>
<body>
<div class="container">
姓名:
<input type="text" id="txt1"/>
國家:
<select id="sel">
<option value="">請選擇</option>
<option value="">中國</option>
<option value="">美國</option>
<option value="">英國</option>
</select>
</div>
</body>
</html>
在chrome中爲
在ie中爲
解決方法:
select {
padding: 10px 0;
}