LLMpediaThe first transparent, open encyclopedia generated by LLMs

CSS

Generated by DeepSeek V3.2
Note: This article was automatically generated by a large language model (LLM) from purely parametric knowledge (no retrieval). It may contain inaccuracies or hallucinations. This encyclopedia is part of a research project currently under review.
Article Genealogy
Parent: Obsidian (software) Hop 3
Expansion Funnel Raw 43 → Dedup 25 → NER 12 → Enqueued 12
1. Extracted43
2. After dedup25 (None)
3. After NER12 (None)
Rejected: 13 (not NE: 13)
4. Enqueued12 (None)
CSS
NameCSS
ParadigmDeclarative programming, Style sheet language
DesignerHåkon Wium Lie, Bert Bos
DeveloperWorld Wide Web Consortium
Latest release versionCSS 3
Influenced bySGML, DSSSL
InfluencedSass (stylesheet language), Less (stylesheet language), Stylus (stylesheet language)

CSS. Cascading Style Sheets is a cornerstone technology of the World Wide Web, used alongside HTML and JavaScript to define the visual presentation of web documents. Developed to separate content from design, it allows web developers to control layout, colors, fonts, and overall aesthetics across multiple pages from a single file. Its specifications are maintained by the World Wide Web Consortium, and it is a fundamental standard implemented by all major web browsers, including Google Chrome, Mozilla Firefox, and Safari (web browser).

History

The concept for CSS was first proposed in 1994 by Håkon Wium Lie while working at CERN with Tim Berners-Lee. The first official recommendation, CSS Level 1, was published by the World Wide Web Consortium in 1996, with significant contributions from Bert Bos. The subsequent CSS Level 2 specification, published in 1998, became a widely supported standard, though its full implementation was a long-term challenge for browsers like Internet Explorer and Netscape Navigator. The development of CSS Level 3, beginning in the late 1990s, modularized the specification, allowing different features like CSS Animations and CSS Grid Layout to progress independently.

Syntax

A CSS rule-set consists of a selector and a declaration block enclosed in curly braces. Declarations within the block are made up of a property and a value, separated by a colon and terminated by a semicolon. This structure allows for the precise targeting of HTML elements, such as `

` or `

`, to apply stylistic instructions. The "cascading" nature of the language means that styles can be inherited from parent elements and that rules are applied based on a specificity hierarchy defined by the World Wide Web Consortium.

Selectors

Selectors are patterns used to select the elements to which a set of rules apply. Basic selectors include type selectors, class selectors (prefixed with a period), and ID selectors (prefixed with a hash). More advanced selectors, defined in the CSS Selectors Level 3 specification, include pseudo-classes like `:hover` and `:nth-child()`, and attribute selectors. The power of selectors is central to applying styles efficiently without modifying the underlying HTML structure, a principle championed by the Web Standards Project.

Box model

The CSS box model describes the rectangular boxes generated for elements in the document tree. Each box comprises content, padding, a border, and margins. The precise calculation of an element's total width and height, historically handled differently by browsers like Internet Explorer, is now standardized. Properties like `box-sizing`, which can change how dimensions are calculated, are critical for creating predictable layouts in complex designs.

Layout

For decades, layout techniques relied on properties like `float`, `position`, and `display`, often leading to complex and fragile code. The introduction of modern layout modules, specifically CSS Flexible Box Layout (Flexbox) and CSS Grid Layout, revolutionized web design by providing robust, two-dimensional control over alignment, distribution, and ordering of items. These systems are now supported in all modern web browsers and are fundamental to the work of organizations like Google and Mozilla Foundation.

Responsive design

Responsive web design is an approach that uses CSS to make web pages render well on a variety of devices and window sizes. Key techniques include fluid grids, flexible images, and CSS Media Queries, which apply different style rules based on characteristics like the viewport width, a concept popularized by Ethan Marcotte. This methodology is essential for modern development, ensuring compatibility across devices from iPhone to Microsoft Surface.

Frameworks and methodologies

To streamline development, numerous CSS frameworks and architectural methodologies have been created. Popular frameworks like Bootstrap (front-end framework), developed by Twitter, and Foundation (framework) provide pre-written, reusable components and a grid system. Methodologies such as Object-Oriented CSS, Block Element Modifier, and Scalable and Modular Architecture for CSS aim to create maintainable, scalable stylesheets for large projects, influencing practices at companies like Facebook and The Guardian.

Category:Style sheet languages Category:Web development Category:World Wide Web Consortium standards