开发者

Center site in the center of the screen

开发者 https://www.devze.com 2023-03-05 11:00 出处:网络
How can I center the whole site in the center of the screen? Both horizontally and vertically; This is the site, see that it is centered horizontally, vertically now missing (any resolution)

How can I center the whole site in the center of the screen?

Both horizontally and vertically;

This is the site, see that it is centered horizontally, vertically now missing (any resolution)

Feel free 开发者_如何学Cto modify the source at this link.


#container {
    width: 400px;
    height: 400px;
    position: absolute;
    top: 50%;
    left: 50%;
    margin: -200px auto auto -200px;
}

jsFiddle.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号