Prevent space before a Heading on the first line only

I’d like to suppress the space before a Heading, only if the Heading is the first line of a Note. Is this possible, eg, using a CSS snippet? I’m currently using the default Theme.

Thanks,
David