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.

sample: http://jsfiddle.net/easwee/kabbf/7/


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -