I want to make drop-down list for categories. How to make text inside select tag centered, I try to put
"text-align : center" so it’s work only on Firefox browser.
I try to solve this problem by using spaces with javascript depending on width of list.
Is there any solution in CSS to another browsers?
Edit
As Pål mentioned, we cannot typically align the text inside select tag
because browsers may use native controls for implementation of these controls.
Most mordren sites use custom component like JQuery UI Selectmenu, or Bootstrap UI.
It’s up to developer & how should implement UI in the website
You cannot typically align the text in these elements since it’s only valid for block level elements (see this for example) and even if it works in one browser, it will typically not work on all operating systems since browsers may use native controls for implementation of these controls.
If you need it centered, either use spacing (which could give varied results however), construct a custom control using DHTML or re-think your requirements.