I have a <div>
I'm trying to line up so all the text is vertical-align: middle;
<div
class="col-md-6"
style="padding-right: 0px; vertical-align: ">
<select
class="DropDownListDark submenu-dropdown"
id="SortProperties_SortBy"
name="SortProperties.SortBy" onchange="sortList()"
style="float: right; vertical-align: middle; ">
<option value="Title desc">Title (desc)</option>
</select>
<span style="float: right; vertical-align: middle; height: 100%; ">Sort by: </span>
</div>
However, the text stays at the top of the <div>
.
When I inspect the <span>
and look at Computed values I don't see anything that would cause that:
box-sizing: border-box
display: block
float: right
height: 15px
line-height: 15.7143px
text-align: left
vertical-align: middle
width: 44px
The containing <div>
has this:
box-sizing: border-box
display: block
float: left
height: 28px
line-height: 15.7143px
min-height: 1px
padding-left: 15px
padding-right: 0px
position: relative
text-align: left
vertical-align: middle
width: 495px
Changing both of them to use display: inline-block;
doesn't fix this either. The text, 'Sort by:' is still aligned at the top of the select control.
How can I fix this?