In this particular instance, it sounds like you added a padding to the blockquote (probably it looks nicer if you also have a background color or border) and because blockquote has a margin-bottom on it by default, the padding-bottom and margin-bottom are adding together.
My current favorite way of dealing with this is like so:
Using Sass:
p, blockquote, .other-margined-elements {
margin: 1rem 0;
&:first-child {
margin-top: 0;
}
&:last-child {
margin-bottom: 0;
}
}
The generated CSS:
p, blockquote, .other-margined-elements {
margin: 1em 0;
}
p:first-child, blockquote:first-child, .other-margined-elements:first-child {
margin-top: 0;
}
p:last-child, blockquote:last-child, .other-margined-elements:last-child {
margin-bottom: 0;
}
With this method, it's just a matter of figuring out which elements to add to the list. My current list is this: h1, h2, h3, h4, h5, h6, p, ul, ol, dl, table, blockquote, div, section, article, aside, fieldset
There are other ways to do this if you feel the preceding code is a bit overboard:
blockquote > :first-child {
margin-top: 0;
}
blockquote > :last-child {
margin-bottom: 0;
}
Thanks to the :first-child
and :last-child
psuedo classes, there's no need to write out every single combination.