1

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
}
CinnamonBun
  • 1,150
  • 14
  • 28
  • 1
    Possible duplicate of http://stackoverflow.com/questions/10813528/is-it-possible-to-center-text-in-select-box – Mike Koch Feb 09 '14 at 21:21

2 Answers2

2

try this .consoles {width: 120px; height: 37px; padding-left:10px;}

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

sir_K
  • 478
  • 3
  • 8
  • 21
0

Referencing this StackOverflow question, this is not possible with plain CSS. However, you can use a jQuery plugin to style the dropdown. When the page is loaded, the plugin converts the select element into span elements on the fly.

Community
  • 1
  • 1
Mike Koch
  • 1,540
  • 2
  • 17
  • 23