Text-align does not work on select control on chrome

I have closed my problem. Centering works in firefox, but not in chrome. Any ideas?

.center_align
{
  text-align: center;
  width: 100%;
}
<html>
<head>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
</head>
<body>
    <select class="form-control center_align">
        <option value="0">   - Välj -</option>
        <option value="1" selected="">   Kategorier valda</option>
     </select>

</body>
</html>
Run codeHide result
+4
source share
1 answer

Usage text-align-last:center;:

.center_align {
  text-align:center;
  width: 100%;
  text-align-last:center;<----------Added
}

.center_align {
  text-align:center;
  width: 100%;
  text-align-last:center;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<select class="form-control center_align">
  <option value="0">   - Välj -</option>
  <option value="1" selected="">   Kategorier valda</option>
</select>
Run codeHide result
+4
source

Source: https://habr.com/ru/post/1681876/


All Articles