To add an external stylesheet to an HTML document, you use the <link> tag within the <head> section. Here's the syntax:
<head>
<link rel="stylesheet" href="styles.css">
</head>
rel="stylesheet"tells the browser that the linked file is a stylesheet.href="styles.css"is the path to your external CSS file. This can be a relative or absolute URL.
For example, if your styles.css file is located in the same directory as your HTML file, this would be sufficient. If it's in a subfolder, like a css folder, the path would be something like href="css/styles.css".
Make sure the <link> tag is placed inside the <head> section of your HTML document.
No comments:
Post a Comment