Open In App

How to include External CSS in an HTML Document ?

Adding External CSS in an HTML document is achieved using the <link> element in the <head> section. This approach allows you to separate your HTML content and styling. Here are some important points:

Syntax

<link rel="stylesheet" type="text/css" href="styles.css">

Example: Implementation to show the addition of external CSS.




<!DOCTYPE html>
<html lang="en">
  
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>External CSS Addition</title>
  
    <!-- Include external CSS -->
    <link rel="stylesheet" type="text/css" href="styles.css">
</head>
  
<body>
    <!-- Your HTML content goes here -->
</body>
  
</html>

Article Tags :