← Back to Glossary

What is CSS?

by Iwan Price-Evans on Web technology • May 23, 2022

CSS stands for Cascading Style Sheets. It’s a way to style HTML elements on a website. You can add colors, fonts, borders, backgrounds, etc. to web pages. This makes it easy to create websites that look great across all devices.

How Does CSS Work?

CSS is a language that allows you to change how the elements on a web page look by adding different styles to individual HTML tags.

You can separate the styles from the HTML document into another document called a style sheet. A style sheet is a collection of rules that tell the browser how to display the elements in the HTML document.

Styles in a style sheet can be applied to HTML tags, IDs, class names, pseudo-elements, and pseudo-classes.

Styles are applied in order according to a hierarchy of importance. The browser reads through the style sheet and applies the styles in order, from top-to-bottom. Styles defined nearer to the bottom of the style sheet take precedence over styles defined nearer to the top of the style sheet.

Developers can override this top-to-bottom hierarchy with the following methods:

  1. Add the parameter !important as a suffix to the style name. A style with this parameter takes precedence over styles defined below it in the style sheet.
  2. Add the style in-line in the HTML. A style defined in-line takes precedence over styles defined in the style sheet.

How Can I Make My Site Look Better?

There are two main ways to use CSS to improve the appearance of a website. First, you can use CSS to modify the appearance of individual elements on a page. Second, you can use CSS classes to apply common formatting properties to multiple elements on a page.

Where Can I Learn More About CSS?

There are lots of places where you can learn more about CSS. One place to start is with Google. Type “CSS tutorial” into the search bar at the top right corner of any browser window. This will bring up a list of results that includes tutorials, articles, and other helpful resources.

One popular resource for learning the basics of HTML, CSS, and JavaScript is W3Schools: https://www.w3schools.com/

A popular community for exchanging tips, answering questions, and sharing more advanced CSS techniques is Stack Overflow: https://stackoverflow.com/