absailesh / dompdf

Automatically exported from code.google.com/p/dompdf
0 stars 0 forks source link

content spread across pages doesn't respect margin-top or padding-top #551

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

Have a single div containing all content after body and set a margin or padding 
to that div. It should have enough content to spread accross pages.

What is the expected output? What do you see instead?

Margin and padding elements to be applied on each page. It seems to work for 
every margin/padding setting except from margin-top or padding-top which only 
works on the first page.

What version of dompdf are you using? What version of PHP? On what
operating system?

0.6.beta3 and tried trunk as well, php 5.3.18, linux debian testing

Please provide the HTML source code you want to convert, or any additional
information.

<html>
<head>
<style>
.content {
  padding: 100px;
}
</style>
</head>
<body>
<div class="content">
Big enough content
</div>
</body>
</html>

Original issue reported on code.google.com by abar...@gmail.com on 1 Nov 2012 at 7:17

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
related to issue #550

Original comment by abar...@gmail.com on 1 Nov 2012 at 7:21

GoogleCodeExporter commented 9 years ago
This is by design. Since the element is continued onto the next page it does 
not re-apply the top margin.

The W3C CSS2 spec doesn't have much guidance for this, but how we have handled 
it is consistent with how web browsers treat paged elements.

In CSS3 there is a means of defining how a box breaks with one option (the 
default) being how we have handled it and the other to reapply the 
margin/border/padding defined for the block.
http://www.w3.org/TR/css3-break/#break-margins
http://www.w3.org/TR/2012/CR-css3-background-20120417/#the-box-decoration-break

You may want to submit a request to support this property. If you do please 
reference this issue.

Original comment by eclecticgeek on 5 Nov 2012 at 4:23

GoogleCodeExporter commented 9 years ago

Original comment by eclecticgeek on 30 May 2013 at 5:16