中心对齐下拉​​列表文本 [英] Centre align drop down list text

查看:109
本文介绍了中心对齐下拉​​列表文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的下拉列表,显示五个不同的游戏控制台。是否可以居中对齐文本?我已经尝试了中心对齐它,但是,这并没有帮助。

I have a simple down drop list which displays five different games consoles. Is it possible to centre align the text? I've tried center aligning it, however, this doesn't help.

html

<select class="consoles">
  <option value="0">Xbox One</option>
  <option value="1">Playstation 4</option>
  <option value="2">PC</option>
  <option value="3">Nintendo Wii</option>
</select>

css

.consoles {
  width: 120px;
  height: 37px;
  text-align:center
}


推荐答案

试试这个 .consoles {width:120px; height:37px; padding-left:10px;}

您可以调整填充以满足您的需求。
http://jsfiddle.net/PawelK/CN8mr/

you can adjust padding-left to suit your needs. http://jsfiddle.net/PawelK/CN8mr/

这篇关于中心对齐下拉​​列表文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆