Lesson 2: CSS Fundamentals
CSS (Cascading Style Sheets) allows you to control the appearance of your HTML elements. In this lesson, you'll learn how to add styles to your web pages.
What You'll Learn
- Understanding CSS syntax and selectors
- Working with colors, fonts, and spacing
- CSS box model
- Layout techniques with Flexbox
- Responsive design basics
CSS Syntax
CSS follows a simple syntax:
selector {
property: value;
property: value;
}
Common CSS Properties
Colors
color: Text colorbackground-color: Background colorborder-color: Border color
Typography
font-family: Font typefont-size: Text sizefont-weight: Text weight (bold, normal, etc.)
Spacing
margin: Space outside elementspadding: Space inside elementswidthandheight: Element dimensions
Resources
- CSS Cheatsheet - Quick reference for CSS properties
- Color Palette - Predefined color schemes
- Layout Examples - Common layout patterns