gglink.ir

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 color
  • background-color: Background color
  • border-color: Border color

Typography

  • font-family: Font type
  • font-size: Text size
  • font-weight: Text weight (bold, normal, etc.)

Spacing

  • margin: Space outside elements
  • padding: Space inside elements
  • width and height: Element dimensions

Resources