An external stylesheet is used to maintain consistent styling across multiple HTML documents by linking it in the <head>
section of each document.
<!DOCTYPE html> <html> <head> <link rel=”stylesheet” href=”styles.css”> </head> <body> <h1>This is a heading</h1> <p>This is a paragraph.</p> </body> </html> |
Create an external stylesheet using a text editor, saving it with a “.css” extension and containing only CSS code. Here’s an example of a “styles.css” file:
body {
|