HTML and CSS
Margins, Borders, and PaddingHTML and CSS - Margins, Borders, and Padding
Margins, Borders, and Padding
Exploring the Box Model
Using Margins
Using Negative Margins
Margin Shorthand
Styling Borders
Border Shorthand
Using Padding
Padding Shorthand
Toward Gaining More Control…
One of the coolest things about CSS is that you can style features such as margins, borders and padding. It's not even just being able to style such things that I find so exciting, but the flexibility we have with the styles available.
By tapping into the CSS visual model, which is referred to as the Box Model, you can add styles to various portions of the box. I'll show you the Box Model in the following section of this tutorial so you can see exactly how the Box Model works, but the point now is that you can style not just all sides of a given box, but also specific sides of that box.