What Is CSS?

Cascading Style Sheets (CSS) is a language that works with HTML documents to define the way content is presented. The presentation is specified with styles that are placed directly into HTML elements, the head of the HTML document, or separate style sheets.

Style sheets contain a number of CSS rules. Each rule selects elements in an HTML document. These rules then define how the elements will be styled.

Any number of HTML files can be linked to a single CSS file.

What Does Cascading Mean?

There are three types of style sheets that can influence the presentation of an HTML document in a browser. These are

  • Browser style sheets Browsers apply style sheets to all web documents. Although these style sheets vary from browser to browser, they all have common characteristics, including black text, blue links, and purple visited links. These are referred to as default browser style sheets.

  • User style sheets A user is anyone who looks at your website. Most modern browsers allow users to set their own style sheets within their browser. These style sheets will override the browser's default style sheetsfor that user only.

  • Author style sheets The author is the person who develops the websiteyou! As soon as you apply a basic style sheet to a page, you have added an author style sheet. Author styles generally override user styles, which override browser styles.