What is CSS
✅ Definition
CSS (Cascading Style Sheets) is a style sheet language used to control the appearance and layout of HTML elements on a web page. While HTML gives a webpage structure, CSS is what makes it look visually appealing.
🎯 Main Purpose of CSS
-
To separate content (HTML) from presentation (CSS)
-
To apply styles such as colors, fonts, spacing, and positioning
-
To make websites responsive and adapt to different screen sizes
🔍 Why "Cascading"?
The word “cascading” means that multiple style rules can apply, and the most specific or latest one wins. CSS uses a priority system:
-
Inline styles (highest priority)
-
Internal styles (in
<style>
tag in HTML) -
External stylesheets (linked via
<link>
) -
Browser default styles (lowest priority)
🎨 What Can You Style with CSS?
-
Text: font, size, color, spacing
-
Boxes: borders, padding, margins, backgrounds
-
Layouts: positioning elements, grid, flexbox
-
Animations: transitions, keyframes
-
Responsive Design: media queries for mobile/desktop