CSS
Connect CSS to your HTML
CSS stands for Cascading Style Sheets. It controls how your page looks. HTML builds the content. CSS makes it look good.
The three ways to add CSS
There are 3 ways to style your HTML. To keep things simple, we’ll use the same example each time: changing the text inside an <h1> tag to be red.
Inline style - Add the
styleattribute directly to a tag.<h1 style="color: red;">Hello!</h1> <!-- This H1 is now red -->Internal style inside a
<style>tag in the<head><head> <style> h1 { color: red; } </style> </head> <body> <h1>Hello!</h1> <!-- This H1 is now red --> </body>External stylesheet in a separate
.cssfile and linked in the<head>HTML FILE
<head> <link rel="stylesheet" href="styles.css"> </head> <body> <h1>Hello!</h1> <!-- This H1 is red --> </body>CSS FILE
h1 { color: red; }
Members only
Keep reading this lesson
You've reached the end of the free preview. Unlock the rest of this lesson plus 12 more lessons in CSS.
- Unlimited coding questions
- Unlimited access to all classroom material
- Weekly live call for questions and guidance
- 3,000 AI tutor tokens / month
- Personal SQL database (3 MB)
- Progress tracking
Cancel any time.