开发者

Center site in the center of the screen

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜