开发者

Div isn't always centred

开发者 https://www.devze.com 2023-04-05 15:50 出处:网络
I have centred everything on the website fine, its just when I r开发者_开发问答esize the window too small so the div is bigger than the window, the div is stuck to the left of the screen, but I want t

I have centred everything on the website fine, its just when I r开发者_开发问答esize the window too small so the div is bigger than the window, the div is stuck to the left of the screen, but I want the div to always be centred. If you don't get what I mean you can view the website here. The 'div' I'm mainly talking about is the blue 'stroke' just above the footer.

I'm viewing this in Google Chrome


A fixed width with absolute positioning will do it.

.page {
    text-align: center;
    margin: 75px 0 auto;
    width: 1000px;
    position: absolute;
    margin-left: -500px;
    left: 50%;
    overflow: hidden;
}

Site.css line 10

0

精彩评论

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