DEV Community

MoonLight
MoonLight

Posted on

box model Mosh

Image description

padding is independent

p {
    padding:20px; 
    margin: 0px;
}
Enter fullscreen mode Exit fullscreen mode

Image description

Image description

but margin is collapsing!

p {
    padding:0px;
    margin: 20px;
}
Enter fullscreen mode Exit fullscreen mode

Image description

Top comments (0)