Front-end - Safari: The font of the select drop-down box cannot be centered.
为情所困2017-05-16 13:24:50
0
2
1311
Using text-align on chrome didn’t work. Then I tried text-align-last:center and it worked, but it didn’t work on Safari; I couldn't find anything valuable after searching on Google. Has anyone encountered it?
Other ways to solve the problem: wrap a layer of p around the select, do not set the width of the select (it is supported by the content), set the width of the container and text-align:center;
There is a hack
Write a span at the select position, use js to bind the value in the span and the value of the select, center the span element, and hide the select.
It looks like this:
Just write the js content yourself
Other ways to solve the problem: wrap a layer of p around the select, do not set the width of the select (it is supported by the content), set the width of the container and text-align:center;