What is CSS for?

As we have mentioned before, CSS is a language for specifying how documents are presented to users – how they are styled, laid out, etc.

A document is usually a text file structured using a markup language – HTML is the most common markup language, but you may also come across other markup languages such as SVG or XML.

Presenting a document to a user means converting it into a form usable by your audience. Browsers, like Firefox, Chrome, or Edge, are designed to present documents visually, for example, on a computer screen, projector or printer.

Note: A browser is sometimes called a user agent, which basically means a computer program that represents a person inside a computer system. Browsers are the main type of user agent we think of when talking about CSS, however, it is not the only one. There are other user agents available – such as those which convert HTML and CSS documents into PDFs to be printed.

CSS can be used for very basic document text styling – for example changing the color and size of headings and links. It can be used to create layout – for example turning a single column of text into a layout with a main content area and a sidebar for related information. It can even be used for effects such as animation. Have a look at the links in this paragraph for specific examples.