Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

text-align not working on select control on chrome [duplicate]

I have capsuled my problem to this. The 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>
like image 816
Anil P Babu Avatar asked Jul 20 '17 13:07

Anil P Babu


1 Answers

Use of 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>
like image 60
Ehsan Avatar answered Oct 03 '22 04:10

Ehsan