What is CSS?

Learn how CSS transforms plain HTML into beautiful, styled web pages.

Step 1 of 5

Why does CSS exist?

In the early days of the web (early 1990s), there was no CSS. If you wanted colored text, you had to put style instructions directly inside your HTML tags. Every single heading, every paragraph, every link had style information mixed in with the content. Imagine writing an essay where every sentence also included instructions about its font and color — it would be unreadable.

CSS was created in 1996 to solve this problem. It separates what the content is (HTML) from how it looks (CSS). This separation is one of the most important ideas in web development, called separation of concerns.

With CSS, you write your styles in one place and they apply across your entire website. Want to change every heading on your 500-page site from blue to red? With CSS, you change one line. Without CSS, you would have to edit all 500 pages.

Think of it this way: Think of CSS like a dress code at a school. The students (HTML elements) are the content — they exist regardless of what they wear. The dress code (CSS) tells everyone how to look: 'shirts must be white, pants must be navy, shoes must be black.' Change the dress code, and everyone's appearance changes at once — you do not have to visit each student individually.
Web Standard
The 'Cascading' in CSS refers to how styles are applied when there are conflicts. If two rules try to set the color of the same element, CSS has a precise set of rules for which one wins. You will learn about this cascade later in the course.