CSS CSS Layout Basics Getting Started with CSS Layout Creating a Sticky Footer

Arikaturika Tumojenko
Arikaturika Tumojenko
8,897 Points

How removing the margin-bottom from the last p element is helping the layout?

I noticed that without this piece of code

p:last-child {
    margin-bottom: 0;

the scroll bar doesn't disappear when trying to create a sticky footer. What's the explanation? How does the margin bottom of the last paragraph affects the 100vh when all paragraphs have the same margins applied, just like the last one? Thank you.