Align vertically using CSS 3

后端 未结 8 1213
忘了有多久
忘了有多久 2020-11-30 19:21

With CSS 3, are there any way to vertically align an block element? Do you have an example? Thank you.

8条回答
  •  醉话见心
    2020-11-30 19:41

    There is a simple way to align vertically and horizontally a div in css.

    Just put a height to your div and apply this style

    .hv-center {
        margin: auto;
        position: absolute;
        top: 0; left: 0; bottom: 0; right: 0;
    }
    

    Hope this helped.

提交回复
热议问题