开发者

Set a page margins

开发者 https://www.devze.com 2023-02-05 11:50 出处:网络
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 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

精彩评论

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