CSS Introduction, Types & Selectors

1. What is CSS?

CSS (Cascading Style Sheets) is used to style HTML elements, control layout, colors, fonts, and more. It separates content (HTML) from presentation (design).

2. Types of CSS

A. Inline CSS

This is inline CSS

B. Internal CSS

This text is styled using internal CSS (blue color for all <p> elements).

C. External CSS

External CSS is written in a separate .css file and linked with <link>. (Not shown here, but works like internal CSS.)

🎨 Color System

color → red text
background-color → lightblue background
border-color → green border
opacity → semi-transparent purple
Name → blue
HEX → #ff0000 red
RGB → rgb(0,128,0) green
RGBA → rgba(255,0,0,0.5) semi-transparent red
HSL → hsl(200,100%,40%) teal blue
HSLA → hsla(300,100%,40%,0.6) semi-transparent purple