Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to make sure select option text align in the center in IE?

The following CSS works in FF, but not in IE(at least 8.0), how can I make sure that the text align in the center for IE8.0? Thanks!!!

select, option {
    text-align: center;
}
like image 953
WilliamLou Avatar asked Dec 15 '09 23:12

WilliamLou


People also ask

How do I center align text in Dropdownlist?

Dropdown button can be positioned in the center of the page by setting the “text-align” property of dropdown div to center. The following example contains a simple Bootstrap dropdown menu with an added class “my-menu”. The property “text-align: center” is added to the class.

How do you center text perfectly?

Select the text that you want to center. in the Page Setup group, and then click the Layout tab. In the Vertical alignment box, click Center.

How do I center my content align?

You can do this by setting the display property to "flex." Then define the align-items and justify-content property to “center.” This will tell the browser to center the flex item (the div within the div) vertically and horizontally.


1 Answers

Unfortunately, you can't change the alignment of SELECT items in IE, although it surprises me that even IE 8 keeps this bad habit.

like image 122
Pekka Avatar answered Oct 07 '22 16:10

Pekka