To link a CSS stylesheet to your HTML document, you can use the <link> tag inside the <head> section. Here’s how to do it:
- Create a CSS file (e.g.,
styles.css) with your styles. For example:
h1 {
color: blue;
}
- Link the CSS file in your HTML document like this:
<!doctype html>
<html>
<head>
<title>My First Web Page</title>
<link rel="stylesheet" href="styles.css" />
</head>
<body>
<h1>Hello HTML</h1>
</body>
</html>
In this example, the <link> tag specifies the relationship (rel="stylesheet") and the location of the CSS file (href="styles.css"). Make sure the CSS file is in the same directory as your HTML file, or provide the correct path if it's located elsewhere.
If you have any further questions, feel free to ask!
