@page :first { margin: … } in Chrome bug?

前端 未结 2 1618
忘掉有多难
忘掉有多难 2020-12-10 13:23

Referring to the full fiddle at: http://jsfiddle.net/XT92a/

@page {
    margin: 1in;
}

@page :first {
    margin: 2in 1in 3in 3in;
}

I exp

2条回答
  •  一整个雨季
    2020-12-10 14:11

    Solution that worked in my case and made all margins similar across all pages. Before, first page used to give bigger margin. Instead of using margin-top:20px use padding-top:20px in the block which is going first in page div. This may be

    Works:

    header {
        margin:0px 80px 20px 80px;
        padding-top:50px;
    }
    

    Not working (gives bigger top margin on first page):

    header {
        margin:50px 80px 20px 80px;
    }
    

提交回复
热议问题