CSS Ways to Add
Learn all ways to add CSS: inline, internal, and external. Understand which one to use in real projects and which ones to avoid.
There are **three ways** to add CSS to HTML. ## 1. Inline CSS CSS written directly inside an element. ```html <p style="color: red;">Hello</p> ``` Use only for: - quick testing - very small changes Avoid in real projects. ## 2. Internal CSS CSS written inside <style> tag. ```html <style> p { color: blue; } </style> ``` Good for: - small pages - demos ## 3. External CSS (best way) CSS written in a separate .css file. HTML: ```html <link rel="stylesheet" href="style.css"> ``` CSS file: ```css p { color: black; } ``` ## Real world usage Professional websites: - always use external CSS - keep design separate from structure ## Remember - Inline = quick but messy - Internal = limited - External = professional choice