Loading

External CSS

  • External CSS is used to separate the styling of an HTML document from its content. 
  • We should define styles in a separate CSS file and link it to multiple HTML files
  • An external style sheet can be written in any text editor, but it must be saved with a .css extension.

Example:

<!DOCTYPE html>
<html>

<head>
    <link rel="stylesheet" href="example.css">
</head>

<body>

    <h1>Welcome to</h1>
    <p>Quipoin.</p>

</body>

</html>

example.css

body {
 background-color: lightblue;
}

h1 {
 color: red;
 margin-left: 10p
 }

Output:

Welcome to

Quipoin.