I have a select element in my HTML form and by default, the text is aligned left. text-align: center;
does not center it like a text input.
From other answers on Stack Overflow, some users say to use the text-indent
property but though it moves the text, it isn't good for aligning different lengths of text.
Though a CSS would be best, a javascript/jQuery solution would be okay.
So finally, how do I go about centering the text in a form select element?
HTML Code:
<select name="country">
<option value="Afganistan">Afghanistan</option>
<option value="Albania">Albania</option>
<option value="Algeria">Algeria</option>
</select>