Loading...
Published on October 2, 2025

HTML + CSS
When building a website, you’ll often want to separate your markup (HTML) from your styling (CSS). The easiest and most common way to do this is by creating a separate CSS file and then linking it to your HTML document. This helps keep your code clean, organized, and easier to update later.
/project-folder ├── index.html └── style.css
To connect your CSS file, open your HTML file and add a <link> tag inside the <head> section.
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>My First Website</title> <link rel="stylesheet" href="style.css"> </head> <body> <h1>Hello, world!</h1> <p>This text will be styled by CSS.</p> </body> </html>
Now that your CSS is linked, you may now beggin to write CSS and style your markup (HTML). For example:
/* style.css */
body {
background-color: lightblue;
font-family: Arial, sans-serif;
}
h1 {
color: darkblue;
}
p {
font-size: 18px;
}Linking your CSS file to your HTML is one of the first steps in web development. By keeping your CSS separate, your project becomes easier to read, configure, and maintain. Once you understand this setup, you’ll be ready to explore the world of web development.