0

I have a select list in my html page which showing in the center in firefox but not in IE

.drop_down1 {
background-color: #7CA942;
border: 1px solid;
color: white;
font-size: 16px;
vertical-align: middle;
text-align: center;
font-family: GemFont One;
width: 200px;
height: 30px;
cursor: pointer;
}

<select  class="drop_down1">
<option value="0">RELIGIOUS</option>
<option value="31">MORMON</option>          
<option value="30">CATHOLIC</option>            

<option value="32">CALVARY</option>         
<option value="1">CHRISTIAN</option>            

<option value="6">SYMBOLS</option>          
<option value="2">JEWISH</option>           

</select>

It's in IE8. please help me

Rob
  • 45,296
  • 24
  • 122
  • 150
bilal shaikh
  • 1
  • 1
  • 2
  • possible duplicate of [how to make sure select option text align in the center in IE?](http://stackoverflow.com/questions/1911111/how-to-make-sure-select-option-text-align-in-the-center-in-ie) – Pekka Feb 28 '11 at 13:33

1 Answers1

0

Use CSS positioning. Best bet is to put it in a DIV tag, and work with the float and margin properties. Many tutorials exist on this subject.

ed209
  • 228
  • 1
  • 7
  • actually i am not getting where to use DIV tag to solve this problem. – bilal shaikh Feb 28 '11 at 14:00
  • I can't extrapolate your page layout to see if the SELECT is in a TD or floating in the page. If you aren't using tables, put the SELECT in a DIV tag. If you're using tables, put centering on the TD. If you're looking to align the text in the dropdown itself, you can't. See the duplicate answer by Pekka above. – ed209 Feb 28 '11 at 14:04
  • i have this type of structure and i want to align center the option element e.g.Rose is it not possible at all i feel so bad i am not able to solve this issue.
    – bilal shaikh Feb 28 '11 at 14:16
  • The only hack is to add   in front of Rose, etc to play with the spacing. See this thread: http://stackoverflow.com/questions/1911111/how-to-make-sure-select-option-text-align-in-the-center-in-ie – ed209 Feb 28 '11 at 14:27
  • I have saw this link and try to implement same but this is also unable to solve the problem – bilal shaikh Feb 28 '11 at 14:40