Style sheet

Updated: 05/01/2023 by Computer Hope
CSS file

A style sheet is a mechanism used to define the overall look and feel of the markup language file. For example, a CSS (cascading style sheets) file contains style sheets that could define the page's font type, background color, and other qualities.

Example of a CSS style sheet

Below is an example of a CSS style sheet that could be saved as a file and used with one or more web pages.

p {
 line-height: 1.7em;
 word-spacing: .05em;
 font-size: 1.1em;
}
h1,h2,h3 { color: #2572cb; }
.example {
font-size: 2em;
} #meta_wrap{
margin: 5em auto .25em
}

Once the above lines are placed into the style sheet, it can be saved as any file name ending with .css. For example, we save our primary CSS file as ch.css.

Once saved as a file, you'd point each HTML (hypertext markup language) web page to the CSS file with a line similar to the following example.

<link href="https://www.computerhope.com/ch.css" type="text/css" rel="stylesheet" />

Markup language, Software terms, <style>, Style, Style guide, Web design terms, XSL