HTML CSS
Connect a CSS file to HTML and understand why CSS is separate from HTML.
David Miller
January 11, 2026
1.0k22
CSS styles your HTML.
HTML should focus on structure, CSS on design.
Link CSS file
Create styles.css and link it in head:
<head>
<link rel="stylesheet" href="styles.css" />
</head>
Example CSS (styles.css)
h1 { color: darkblue; }
p { font-size: 18px; }
Preview
Your heading becomes dark blue, paragraph becomes bigger.
Why separate file is better
- easy to manage
- same CSS can style multiple pages
#HTML#Beginner