Center Align Select Menu Text in HTML

Ever needed to center align Select Menu Text in HTML with CSS? If you did and succeeded with text-align: center in FireFox but failed in Chrome then fear not as we are giving you this simple tip to make it work in Chrome and Safari on both desktop as well as in mobile phone screens.



Simply use the following piece of code to center align text in the select menu.

select {
  text-align: center;
  text-align-last: center;
  /* webkit*/
}

Note: This solution is to center align the placehold/selected text option within select menu not the individual options’ text.

Got any tips of yours to share with us? If you do then please share with us through the comments section below.



Comment

There is no comment on this post. Be the first one.

Leave a comment