Home >Web Front-end >CSS Tutorial >How to Link a CSS File to an HTML File?
In HTML, you can link a CSS file to style your web page using the tag. Here's how you can do it:
In your HTML file, add the tag inside the
section:<head> <link rel="stylesheet" href="newcssstyle.css" type="text/css"> </head>
Make sure to replace "newcssstyle.css" with the name of your CSS file. The rel attribute specifies the relationship between the HTML file and the linked file. The stylesheet value indicates that the linked file is a stylesheet. The href attribute specifies the path to the CSS file.
If your link is not working, check the following:
Remember to save your HTML file and refresh the page to see the applied styles.
The above is the detailed content of How to Link a CSS File to an HTML File?. For more information, please follow other related articles on the PHP Chinese website!