CSS Boxes
Block tags like div ,p,
and h1 live in a "box".
Working from the inside out, you have.
- The text or image content wrapped
as appropriate taking up horizontal and
vertical space.
- The padding is the
space between the content and the border
and is colored the same as the text.
-
The border has its own
color and width.
-
The margin is the space
between the border and
the rest of the elements in the document.
- Also note that while the ul
and li items are
children of the p
tag, they have their own
background-color.
But you can have a paragraph inside of
a list.
-
And a list item can have its own background color.