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)

🌚 Turn on dark mode

🔠 Change your default font

📚 Adjust your experience level to see more relevant content

Head to your account's Settings to do all this and more.