What is CSS?
A one-page briefing: what CSS is for, how a rule is written, and MDN’s official word on CSS3 and CSS4.
css.programmers.im
MDN’s official CSS page is unambiguous: there will never be a CSS3 or a CSS4. Everything is now just “CSS”, with individual modules having version numbers. [source]
This is a beginner-friendly, sourced guide to CSS, the language of style rules for web documents.
MDN’s official CSS page has a surprise for anyone still talking about “CSS3”: there will never be a CSS3 or a CSS4. This desk keeps that answer, and the other official wording around it, with a source on every paragraph.
MDN’s CSS landing page says you might have heard about CSS1, CSS2.1, or even CSS3. Then it is unambiguous: “There will never be a CSS3 or a CSS4; rather, everything is now just “CSS” with individual CSS modules having version numbers.” [source]
The same page explains that after CSS 2.1 the work split into modules, and that the W3C now takes snapshots of the latest stable state. Modules have levels, such as CSS Color Module Level 5. [source]
MDN’s CSS landing page says you might have heard about CSS1, CSS2.1, or even CSS3. Then it is unambiguous: “There will never be a CSS3 or a CSS4; rather, everything is now just “CSS” with individual CSS modules having version numbers.” [source]
The same page explains that after CSS 2.1 the work split into modules, and that the W3C now takes snapshots of the latest stable state. Modules have levels, such as CSS Color Module Level 5. [source]
MDN’s beginner article “What is CSS?” opens: “CSS (Cascading Style Sheets) allows you to create great-looking web pages, but how does it work under the hood?” [source]
Under “What is CSS for?” it says: “Using CSS, you can control exactly how HTML elements look in the browser, presenting your documents to your users with whatever design and layout you like.” [source]
The MDN glossary, a separate page, says: “CSS is one of the three core Web technologies, along with HTML and JavaScript.” [source]
Even with no author stylesheet, a heading looks larger than regular text, paragraphs break onto a new line, and links are colored and underlined. MDN calls these the browser’s default styles — “very basic styling that the browser applies to HTML to make sure that the page will be readable even if no explicit styling is specified by the author of the page.” [source]
“These styles are defined in default CSS stylesheets contained within the browser — they have nothing to do with HTML.” [source]
The official glossary says: “A CSS rule is a set of properties associated with a selector.” [source]
MDN’s selectors lesson adds: “A CSS selector is the first part of a CSS Rule. It is a pattern of elements and other terms that tell the browser which HTML elements should have the CSS property values inside the rule applied to them.” [source]
MDN’s lesson on handling conflicts says the first word in Cascading Style Sheets — cascading — is key. “The Cascade, and the closely-related concept of specificity, are mechanisms that control which rule applies when such a conflict occurs.” [source]
“Stylesheets cascade. At a very simple level, this means that the origin and the order of CSS rules matter. When two rules both have equal specificity, the one that is defined last in the stylesheet is the one that will be used.” [source]
MDN’s box-model lesson opens: “Everything in CSS has a box around it, and understanding these boxes is key to being able to create more complex layouts with CSS, or to align items with other items.” [source]
A block box is made up of a content box, a padding box, a border box and a margin box. In the standard model, width and height size the content; padding and borders are added on. Margin affects the space outside, but is not counted in the size of the box. [source]
Everything in CSS has a box around it. Tap a layer to read its official job. [source]
Content box. The area where your content is displayed; size it using properties like width and height. [source]
Tap a layer to read its official job. The diagram is ours; the wording is from MDN’s box-model lesson.
Three short fact sheets you can print. No checkout, no email, no registration. Each one is offered in A4 and US Letter.
A one-page briefing: what CSS is for, how a rule is written, and MDN’s official word on CSS3 and CSS4.
A labelled diagram of content, padding, border and margin, the official worked example, and a short quiz.
Cascade, specificity and source order, in plain language, with a three-question quiz and answers.
No pop-ups. No intrusive advertising. Just interesting stuff. A little support helps the next programmers site get built.