{"id":304584,"date":"2020-03-09T13:43:24","date_gmt":"2020-03-09T20:43:24","guid":{"rendered":"https:\/\/css-tricks.com\/?p=304584"},"modified":"2020-03-09T13:43:25","modified_gmt":"2020-03-09T20:43:25","slug":"negative-margins","status":"publish","type":"post","link":"https:\/\/css-tricks.com\/negative-margins\/","title":{"rendered":"Negative Margins"},"content":{"rendered":"\n

PPK digs into the subject<\/a>, which he found woefully undercovered in web tech documentation. Our entry<\/a> doesn’t mention them at all, which I’ll aim to fix. <\/p>\n\n\n\n

Agree on this situation:<\/p>\n\n\n\n

This is by far the most common use case for negative margins. You give a container a padding so that its contents have some breathing space. However, you want the header to span the entire container, ignoring the padding. Negative margins are the way to go.<\/p><\/blockquote>\n\n\n\n\n\n\n\n

Like this:<\/p>\n\n\n\n