☼
⌃
☰

Cascading Style Sheets

Table of Contents

Cascading Style Sheets

Core Principles

The power of CSS comes from a few core principles that dictate how styles are applied to elements.

  • CSS Core Concepts: These rules determine which style declarations take precedence when multiple rules apply to the same element.
  • CSS Selectors: Patterns used to select and target the HTML elements you want to style.
  • CSS Box Model: The foundational model that treats every HTML element as a rectangular box, with properties for content, padding, border, and margin.
  • CSS Layout: Techniques and properties, like Flexbox and Grid, used to arrange elements on the page.

Common Properties

CSS has hundreds of properties. Some of the most frequently used include:

  • Typography: font-family, font-size, font-weight, color, text-align
  • Backgrounds & Borders: background-color, background-image, border, border-radius
  • Sizing: width, height, min-width, max-height
  • Spacing: margin, padding

Frameworks and Libraries

To speed up development, many developers use pre-built CSS frameworks.

  • Picocss: A minimalist CSS framework for semantic HTML, providing elegant styles with very little overhead.