Wondering what is CSS and why every website looks different? CSS is the style language that tells browsers how HTML content should look, from colors and fonts to spacing and layout.
This guide belongs to our web development basics series, so it assumes no coding background.
| Item | Value |
|---|---|
| What CSS describes | How elements are rendered on screen, on paper, in speech, or on other media |
| Who standardizes it | W3C specifications, shared across web browsers |
| Basic building block | A selector followed by a declaration block |
| Each declaration | A property and value pair, split by a colon |
| Declarations are separated by | A semicolon |
These points come from MDN’s CSS reference and its CSS styling basics lesson. Web standards change, so check those pages before you rely on the details.
What is CSS actually for?
CSS stands for Cascading Style Sheets. MDN’s reference says that CSS describes how elements should be rendered on screen, on paper, in speech, or on other media. In practice, that means colors, fonts, spacing, borders, backgrounds and page layout.
The same page adds that CSS is among the core languages of the open web, standardized across web browsers according to W3C specifications. Every major browser follows the same shared rules, so one stylesheet can work across them all.
If you have not met the markup side yet, read what is html first. HTML supplies the content and its structure, and CSS decides how that content looks.
What does a page look like without CSS?
Open an HTML file with no stylesheet and you still see something readable. MDN explains that these are the browser’s default styles: very basic styling the browser applies to HTML to make sure the page will be readable even if the author specifies no explicit styling.
Those defaults live in default CSS stylesheets contained within the browser, and they have nothing to do with HTML itself. When you write your own CSS, you are overriding or extending that built-in look.
How a CSS rule is written
CSS is built from rules. Here is the smallest useful example: p { color: red; }. Each part has a name, and MDN’s lesson spells them out.
- Selector: in MDN’s example, p is called a selector, and it selects the element or elements to style.
- Declaration: the line inside the curly braces sets a value for a specific property.
- Property and value: here the property is color, which controls the text color of the paragraphs, and the value is red.
The curly braces create a declaration block, which holds one or more declarations in the form of property and value pairs. Within a ruleset you separate one declaration from the next with a semicolon, and inside each declaration a colon separates the property from its value.
The sources describe these two punctuation marks as required, so a missing one is the most common reason a rule silently fails. If you want one rule to style several elements, MDN notes that you can include multiple selectors in one rule, separated by commas.
How the browser applies CSS to your page
There is a clear order of events when a page loads. The browser first receives the HTML document and converts it to a DOM tree, which is its internal model of the page. The CSS rules are then applied to that tree, resulting in a render tree, which is painted to the browser window.
That sequence explains why CSS and HTML stay separate. You can change the look of a whole site by editing the stylesheet without touching the content.

Adding a stylesheet to an HTML page
The usual route is a separate file. Following MDN’s beginner project, you save your rules in a file inside a styles folder, then connect it with a link element in the page.
- Create a plain text file with a name such as style.css and write a first rule in it.
- Open your HTML file and find the head section.
- Add the link element inside the head, just before the closing head tag, pointing to your stylesheet file.
- Save both files and reload the page in your browser.
MDN recommends starting with something simple, such as turning paragraph text red, to test whether the stylesheet is being applied correctly. Once that works, you can add real rules. You can read the step-by-step version in MDN’s CSS styling basics page.
Where CSS fits with HTML and JavaScript
Think of a web page as three layers. HTML provides the structure, CSS provides the presentation, and a third language adds behavior. To see that third layer, read what is javascript used for.
CSS itself is no longer released as one numbered package. W3C now periodically takes a snapshot of the latest stable state of the CSS specification and of how individual modules are progressing, according to MDN. Features arrive module by module, which is why you will see names such as the Color module in specifications.
Frequently asked questions
Do I need to know HTML before learning CSS?
Show answer
Yes, it helps. MDN’s own lesson lists HTML familiarity as a prerequisite, because CSS rules need elements to select.
Can one rule style more than one element?
Show answer
It can. List the selectors with commas between them, and the declarations in the block apply to all of them.
Will there be a new numbered version of CSS?
Show answer
Not according to MDN, which says there will never be a CSS3 or a CSS4. Version numbers now belong to individual modules, which carry level numbers.
Why does an unstyled page still look readable?
Show answer
Your browser ships with its own basic stylesheet. Your CSS is layered over that starting point.



