CSS Fundamentals 5 min readLesson 1 of 2
CSS Introduction & Syntax
Learn CSS syntax, selectors, specificity, and how to attach CSS to HTML.
### What is CSS? CSS stands for Cascading Style Sheets. It describes how HTML elements should be displayed on screen, paper, or in other media.
CSS Syntax A CSS rule-set consists of a selector and a declaration block:
css
selector {
property: value;
property: value;
}Example ```css h1 { color: #2563eb; font-size: 28px; text-align: center; } ```
3 Ways to Insert CSS 1. **External CSS**: Linked via `<link rel="stylesheet" href="styles.css">`. 2. **Internal CSS**: Defined inside `<style>` tags in `<head>`. 3. **Inline CSS**: Added directly inside element tags via `style=""`.
Interactive Sandbox
CSS Modern Card Demo
Live W3-EditorEdit code below and see instant live output in the preview box
Source Code InputHTML / CSS / JS
Live Browser Result Live Result
Test Yourself With Exercises
Verify your understanding before moving to the next topic
What does CSS stand for?
First Lesson of Course
Next: CSS Flexbox Layout ❯