How to vertically align a DIV next to an image?

前端 未结 3 2091
栀梦
栀梦 2021-01-04 07:34

I have the following html code:

\"\"
3条回答
  •  情书的邮戳
    2021-01-04 08:10

    basically what I would do is:If you can specify a fixed height (corresponding to your image height) for your outer container(#personalInfo div)..do it! then I will set this #personalInfo position to relative. After that I will set your #details div position to absolute so that I can shift it to 50% from top and i would set margin-top:-yy where yy is half the height of the #details to offset the item up:

    give a look here

提交回复
热议问题