Unit 5 - CSS

Topics

CSS

Explanation: CSS is used to style HTML elements.

It changes color, size, spacing and layout.

Background Color

Example:

p {
background-color: yellow;
}

This is background color

Border

p {
border: 2px solid black;
}

Border Example

Margin

Margin creates space outside element.

This box has margin

Padding

Padding creates space inside element.

This box has padding

Box Model

Every element is a box with margin, border and padding.

This is box model example