CSS (Cascading Style Sheets) is the language we use to style an HTML document. CSS describes how HTML elements should be displayed on screen, paper, or in other media test.
Key Concepts
CSS saves a lot of work. It can control the layout of multiple web pages all at once.
- Selectors: Patterns used to select the element(s) you want to style.
- Properties: The specific aspect of the element you want to change (e.g., color, font-size).
- Values: The setting you want to apply to the property (e.g., red, 16px).
The Box Model
All HTML elements can be considered as boxes. In CSS, the term “box model” is used when talking about design and layout. It consists of:
- Margins: Clears an area outside the border.
- Borders: A border that goes around the padding and content.
- Padding: Clears an area around the content.
- Content: The actual content of the box, where text and images appear.