NO BUG: Where does this weird margin-top come from?

Browser: Chrome 110
OS: macOS / Windows / Linux / etc.
URL: Link to a page that illustrates this issue
Video: Short screen recording that illustrates this issue (free tool: jam.dev)

When I was laying elements in a blank page, I found that there would be a strange margin-top on the headings when the layout order is “basic text” - “heading”.

The margin-top shows when the text tag is p, when the tag is div, it disappears.

I deactivated all my plugins and theme styles, and it was still there.

@timmse

Hello, Please come and take a look, is it a default setting from the bricks theme?

Hi Mezzy,
There’s really no reason to tag us after just three hours :smiley:

You can see the reason for this in your screenshot. As soon as a heading follows a p, a margin-top is added, as otherwise, the heading would “stick” directly under the paragraph.

If you don’t want this, you can, of course, override the styles. Either on that specific heading, the wrapper, or generally in Bricks » settings » custom CSS (where it applies everywhere).

:where(p:last-of-type) + :is(h1, h2, h3, h4, h5, h6) {
  margin-top: 0;
}

Best regards,
timmse