开发者

Set a page margins

I have this stylesheet, but the right and left margins are too large (about 5 cm), I don't know how to reduce them. I'd like to have 3 cm right and left.

I tried to change page_width, but it did't work.

Thanks,

开发者_Python百科 rubik


Okay, well number one your

div.document {
    width: {{ page_width }}px;
    margin: 0 auto;
}

is set to margin: 0 auto; which makes it centered so your page will be 940px and will be centered (Resizing your page will confirm this). You probably have to change your content width along with the wrapper width, but keep in mind that the amount of padding depends on how large your viewport is.

Alternate

If you just want to make it strictly 3cm on the left and right sides and make the content in the middle have a fluid layout you can do this:

        margin: 0 3cm;
        position: absolute;
        width: auto;
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜