Lesson 2 of 2

CSS Fundamentals

Style your HTML with CSS — colors, fonts, layouts, and more.

20 minutes

CSS Fundamentals

CSS (Cascading Style Sheets) controls the visual presentation of your HTML.

What You'll Learn

  • CSS syntax and selectors
  • Colors, fonts, and typography
  • The box model (margin, padding, border)
  • Basic layouts with flexbox

Why CSS Matters

While HTML provides structure, CSS makes your pages beautiful and user-friendly.

Code Example

body {
  font-family: 'Arial', sans-serif;
  background-color: #f5f5f5;
}

h1 {
  color: #333;
  text-align: center;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}