Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disposition of HTML-Select having UTF-Icons

Having this HTML

<select>
 <option>🏢Foo</option>
</select>

<select>
 <option>Foo</option>
</select>

The secodn input is dispositioned. How to avoid this effect?

like image 511
Grim Avatar asked Dec 02 '17 12:12

Grim


2 Answers

The UTF character is taller than the text, so it is displacing the select box.

I've added a bit of CSS to fix it - vertical-align: middle to line the select boxes up with each other; and line-height: 1.75em to make the character visible.

select {
    vertical-align: middle;
    height: 1.75em;
}
<select>
 <option>🏢Foo</option>
</select>

<select>
 <option>Foo</option>
</select>
like image 131
Yvonne Aburrow Avatar answered Nov 14 '22 16:11

Yvonne Aburrow


Try this.

select {
    display: inline-block;
    vertical-align: middle;
}
<select>
 <option>🏢Foo</option>
</select>

<select>
 <option>Foo</option>
</select>
like image 3
Bagrat Zakaryan Avatar answered Nov 14 '22 17:11

Bagrat Zakaryan