Lesson
1 / 6What is CSS?
CSS (Cascading Style Sheets) controls how HTML elements look. It handles colors, fonts, spacing, layout - everything visual. 'Cascading' means styles can override each other based on specificity and order.
code.txt
/* CSS Syntax: selector { property: value; } */
h1 {
color: blue;
font-size: 32px;
}
p {
color: #333;
line-height: 1.6;
}
/* Multiple properties */
.button {
background: #007bff;
color: white;
padding: 10px 20px;
border-radius: 5px;
}If
HTML is the skeleton, CSS is the skin, clothes, and makeup. It transforms bare bones into something beautiful.
💡
Pro tip: CSS can be written inline, in <style> tags, or in external .css files. External files are best for maintainability.