Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS What are the best ways to deal with different bottom margins? Reply To: What are the best ways to deal with different bottom margins?

#148759
Tom Houy
Participant

Why not just use an Adjacent Sibling Combinator? You could specify a unique margin on the H2 for any instances where it comes directly after an H1, without the need to add custom class markup to the HTML itself.

Something like:

h1 + h2 {
margin-top: 5px;
}