Forum How do I...?

Margin for elements at the beginning of a page

melusina.press
There are elements for which I need to set margin-top values. However, these only make sense when they appear somewhere in the textflow below others. It doesn't make sense to apply it, if it is the first element on a page. Think, for instance, of a header that needs to have a bigger margin-top than maring-bottom of a p.

Is there a mechanism in which the margin is only applied when not at the top? Obviously, the layout looks weird, if content on verso starts at another position than recto, just because a header moved to the beginning of a page.

I know, because this seems a quite common case, that for float top|bottom|snap you provide such a property, defining the margin of an element if it hits a vertical edge, but for the case above, I do not really find something.