# Lesson 1: Introduction to CSS *Duration: 45 minutes | Difficulty: Beginner | Prerequisites: Basic HTML knowledge* ## 📋 Learning Objectives By the end of this lesson, you will be able to: - [ ] Define CSS and explain its purpose in web development - [ ] Identify the three methods of applying CSS to HTML - [ ] Write basic CSS rules using proper syntax - [ ] Understand the cascade and specificity concepts - [ ] Apply inline, internal, and external CSS to HTML documents ## 🎯 Key Concepts ### What is CSS? **CSS (Cascading Style Sheets)** is a stylesheet language used to describe the presentation of HTML documents. While HTML provides the structure and content, CSS controls the visual appearance, layout, colors, fonts, and overall design. ### Why Use CSS? - **Separation of Concerns**: Keep content (HTML) separate from presentation (CSS) - **Consistency**: Apply consistent styling across multiple pages - **Maintainability**: Change the entire site's appearance by modifying CSS files - **Flexibility**: Create responsive designs that work on different devices - **Performance**: Reduce code duplication and improve loading times ### CSS Syntax ```css selector { property: value; property: value; } ``` **Example:** ```css h1 { color: blue; font-size: 24px; text-align: center; } ``` ## 🔧 Three Methods of Applying CSS ### 1. Inline CSS Applied directly to HTML elements using the `style` attribute. ```html
This is red text.
``` **Pros:** Quick for single-element styling **Cons:** Not reusable, hard to maintain, mixes content with presentation ### 2. Internal CSS Defined within `This paragraph will be green.