Re: [csswg-drafts] [css-page] control space before element depending on page position

Hi Sebastian,

thanks for pointing us to the issue tracker and for your first answer.

I don't think that `:first-of-type` is a solution for 
@christin-goetz's requirement as it does not take into account the 
current position on the page (which may be unequal to the current 
position in the DOM).

Say weh have the following structure:
```
<h1>
<p>
<p>
...
<p>
<h2>
<p>
<p>
<h2>
<p>
<p>
```
and the following css snippet
```
heading {
    margin-top: 2em;
    }
``` 

The `h2` element should display WITH margin top when rendered 
somewhere on the page, surrounded by paragraphs. But it should render 
WITHOUT margin top when it is the first item on the new page.

The `:first-of-type` selector would only match the first occurance of 
`h2` regardless of whether or not it is rendered at the bottom or as 
the first item on the page. And it wouldn't even match the 2nd 
occurance.

Did this example made our point clearer?

Regards,
Tobias

-- 
GitHub Notification of comment by tofi86
Please view or discuss this issue at 
https://github.com/w3c/csswg-drafts/issues/253#issuecomment-229363009 
using your GitHub account

Received on Wednesday, 29 June 2016 13:55:24 UTC