For the CSS gurus out there, I cannot figure out the css that makes the first label/select pair not middle align, but the second one does align in the middle.
See the problem in the image below. My goal is to make the first label/select pair align in the middle and to understand the css rules that make it happen.
<div class="pure">
<form class="pure-form-inline">
<div class="pure-g">
<div class="pure-u labelArea">
<label>Choose Project:</label>
</div>
<div class="pure-u-1-4">
<select></select>
</div>
</div>
<div class="pure-control-group">
<label>Choose Customer:</label>
<select></select>
</div>
</form>
</div>
Here is where you can see this in action...Fiddle
Try with this vertical align fix:
/* Vertical Align Fix */
Give the class (.valign) to the parent (The div containing the select)
And this other class to the inner elements (select + label)
See if it works.
An easy way to do this is to give the
label
elements a line-height equal to that of the height of the dropdown selector. However, this solution depends on your labels only being a single line of text, if you have any labels that are multi-line it will not work and you should use thevertical-align
method detailed above.Updated JSFiddle
You have additional
div
s around the firstlabel
/select
pair, which force this behaviour.If you remove the unnecessary
div
s around the firstlabel
/select
pair and add the same class as in the second, you should be fineModified JSFiddle