HTML Style Sheet

Learn how to apply HTML stylesheet to a web page.

HTML stylesheet refers to the section of an HTML document that defines the styles and formatting to be applied to the content of the document. This is done using CSS (Cascading Style Sheets) rules, which are written in a separate file and linked to the HTML document using a "link" element in the HTML "head" section.

Here's an example of an HTML stylesheet:

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

And here's an example of a simple CSS rule:

p {
  font-size: 14px;
  colour: black;
  text-align: justify;
}

This rule sets the font size of all "p" elements (paragraphs) to 14 pixels, the text color to black, and the text alignment to "justify". The CSS rules define how the content of the HTML document should look, and by separating the content from the styling, you can easily apply the same styles to multiple HTML pages, which helps keep your code organized and maintainable.

Last updated