CSS
Also known as: Cascading Style Sheets
Style sheet language that controls the layout, colors, typography and visual presentation of HTML documents on the web.
CSS, or Cascading Style Sheets, is the language used to describe how web documents are presented. Style rules pair selectors, which pick out elements in an HTML document, with declarations that set properties such as color, font, spacing, size and position. The cascade determines which rule wins when several apply, based on origin, specificity and order, and many properties are inherited from parent elements. Separating presentation from content lets the same document be styled differently for screens, print and other media.
Hakon Wium Lie proposed CSS in 1994 while working with Tim Berners-Lee at CERN, and he developed it further with Bert Bos. The World Wide Web Consortium published CSS level 1 as a Recommendation in 1996 and CSS 2 in 1998. Inconsistent browser support slowed adoption for years. Instead of one monolithic CSS3, the language has since evolved as separate modules, bringing Flexbox and Grid for layout, custom properties, animations, media queries and container queries.
Media queries made responsive web design possible, letting one site adapt to phones, tablets and desktops, while Grid and Flexbox replaced fragile layout hacks built on tables and floats. CSS also matters for web accessibility: careful choices about contrast, focus indicators, motion and text sizing affect who can use a site. The cascade and specificity are frequent sources of difficulty in large projects, which encouraged naming conventions, utility frameworks and scoped styles in component frameworks.
Key points
- CSS rules pair selectors with declarations that set visual properties.
- Hakon Wium Lie proposed CSS in 1994, and the W3C published CSS level 1 in 1996.
- Flexbox and Grid provide dedicated layout systems for web pages.
- Media queries enable responsive designs that adapt to different screen sizes.
Related entries
HTML
Markup language used to structure content on the World Wide Web, describing headings, paragraphs, links, images and interactive elements.
World Wide Web Consortium
International standards organization that develops open technical standards and guidelines for the World Wide Web, including CSS and accessibility guidelines.
Responsive Web Design
Approach to web design in which page layouts adapt fluidly to the screen size and capabilities of each device, from phones to desktop monitors.
Web Accessibility
Practice of designing and building websites and apps so that people with disabilities can perceive, understand and operate them fully.
Document Object Model
Programming interface that represents a web page as a tree of objects, letting scripts read and change its content, structure and style.
MDN Web Docs
Free documentation resource maintained by Mozilla and contributors that covers HTML, CSS, JavaScript and web APIs for developers.
W3Schools
Educational website offering free tutorials, references and interactive examples for HTML, CSS, JavaScript, SQL, Python and other web technologies.
JavaScript
High-level programming language of the web, created at Netscape in 1995, that runs in every major browser and on servers through runtimes like Node.js.
Featured in guides
Referenced by
Other entries that discuss or point to CSS.