CSS how to position element in half height (vertical 50%) -
i'm looking forwards build tooltip positioned next element. it's easy set on , under in center of element. there way vertically?
for purpose, height of element known & height of tooltip not. , tooltip can kid of element.
but, i'm curious how when both heights unknown.
using css & jquery-
css.div{ top:50% }
jquery var divheight = $(.div).height() / 2; $(.div).attr('style','margin-top:-'+divheight+'px;');
css height vertical-alignment
No comments:
Post a Comment