Vertically align div (no tables)

后端 未结 8 1326
孤街浪徒
孤街浪徒 2020-12-02 17:38

I can horizontally align a div and all the content looks nice. Looking to vertical align a div that does not contain any tables. I tried setting margin positions to some neg

8条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-02 18:07

    I think it is possible to do it without display: table.

    this is the example:

    HTML:

    something

    CSS:

    .notificationArea
    {
        position: absolute;
        top: 50%;
        bottom: 50%;
        right: 50%;
        left: 50%
    }
    

提交回复
热议问题