html:
<select>
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
</select>
CSS:
select {
width: 100px;
height: 30px;
text-align: center;
text-align-last: center;
}
html:
<select>
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
</select>
CSS:
select {
width: 100px;
height: 30px;
text-align: center;
text-align-last: center;
}
本文标题:CSS将select/option文本居中
本文链接:https://www.haomeiwen.com/subject/hrzinftx.html
网友评论