CSS Box Model | Sololearn: Learn to code for FREE!


CSS Box Model

Why does Padding, Border, and Margin give the same output?: #margin { padding-left: 50px; } -------------------- #margin { margin-left: 50px; } -------------------------- #margin { border-left: 50px; } What is the reason? My text is still aligned at the same place. I thought that they were different.

4/12/2020 3:52:21 PM

Koopa Scripter

4 Answers

New Answer


It's a selector for the class ".wp" and ".wwp" that has <div> as their parent


Add background color so you can see everything clearly https://code.sololearn.com/W35ej413geBk/?ref=app


Hi Koopa first, tanks for your question due to it cuz i search for it and know something more😉 Margin is the outer space of an element, whilepadding is the inner space of an element and border is an outer space that can be colored


Mirielle Thank you for the code example. But what do you mean with div > .wp