html - Centering a label + dropdown inside of a div -
i have following html:
a div, contains label , drop down list (select) label. putting vertical-align:center on both label , dropdown, result label centered, dropdown not centered. consider centered "equal spacing above , below dropdown". ie apparently considers centered aligning bottom of drop down list bottom of label, which, unfortunately, not good. how can fix this?
edit: isn't urgent since position:relative; fixed issue using position:relative; annoys me , shouldn't necessary.
you missusing vertical-align property. work intended in table cell. not on div. vertical-align:middle; not center.
vertical-align:middle: aligns vertical midpoint of element baseline of parent element plus half x-height of parent.
i think article explains why: http://www.ibloomstudios.com/articles/vertical-align_misuse/
the key baseline here point towards element get's aligned.
Comments
Post a Comment