Cascading Style Sheets (CSS)
Cascading Style Sheets (CSS) is a style sheet language primarily used to dictate the visual presentation of documents written in markup languages such as HTML or XHTML. As a cornerstone of modern web development, CSS works alongside HTML and JavaScript to create visually appealing and functional web content. One of its key advantages is the ability to separate content from presentation, allowing developers to make widespread design changes by simply altering a few lines in a CSS file rather than modifying the underlying HTML code, which can be more cumbersome.
CSS was first specified in 1996, but its adoption was slow, with full support not achieved until 2000. This gradual integration led to inconsistencies in how websites appeared across different browsers, an issue largely resolved by 2009. CSS enables considerable flexibility in web design, allowing for the customization of layout, colors, fonts, and more, making it possible to create multiple styles for the same website. This functionality is particularly useful for rendering different versions of a site for desktop and mobile devices or for accessibility purposes, such as creating Braille or speech-based browser formats. Overall, CSS plays a vital role in shaping user experiences on the web by enhancing visual aesthetics and improving content accessibility.
On this Page
Subject Terms
Cascading Style Sheets (CSS)
Cascading Style Sheets (CSS) is a style sheet language used to describe the visual presentation of a document that has been written in a markup language, typically HTML or XHTML. CSS is one of the core technologies for creating modern Internet content and defining its visual design and presentation, in conjunction with HTML (the markup language in which web pages are written) and JavaScript (the high-level programming language that allows for greater functionality and server-side web applications). Using both CSS and HTML allows the programmer to change the graphic design of a document or entire website by changing a few lines within the CSS file, whereas making the equivalent changes in HTML would be more laborious.
![A graphic that depicts the css cascade for a paragraph tag, modified to include padding. By Armchair (Own work) [CC BY-SA 3.0 (http://creativecommons.org/licenses/by-sa/3.0)], via Wikimedia Commons 113931114-115271.jpg](https://imageserver.ebscohost.com/img/embimages/ers/sp/embedded/113931114-115271.jpg?ephost1=dGJyMNHX8kSepq84xNvgOLCmsE2epq5Srqa4SK6WxWXS)
![Taxonomy and status of CSS3 modules. By Krauss (Own work) [CC BY-SA 4.0 (http://creativecommons.org/licenses/by-sa/4.0)], via Wikimedia Commons 113931114-115272.jpg](https://imageserver.ebscohost.com/img/embimages/ers/sp/embedded/113931114-115272.jpg?ephost1=dGJyMNHX8kSepq84xNvgOLCmsE2epq5Srqa4SK6WxWXS)
Overview
The first CSS specification was completed in 1996, and found limited support in Internet Explorer 3 and, in the following year, Netscape 4. Not until the Macintosh version of Internet Explorer 5, in 2000, did a browser have full CSS support. Throughout the 2000s, the patchy adoption of CSS support was one of the contributing factors to websites rendering differently in different browsers. By 2009, these problems had largely been smoothed out, at least among the most commonly used browsers. Cross-browser testing of websites remains a necessity, in part because of the rate at which browser software updates, and the minor changes that can be wrought to the way the software implements CSS as a result.
One of the benefits of CSS is "the separation of presentation and content," a common idiom in design and publishing technology. This is a specific application of two broader principles: separation of concerns, and the form and content principle. Separation of concerns states that a computer program (or, in the case of CSS, a document) should be written in well-defined sections, each of which addresses a well-defined concern. What that means depends on the nature and scope of the program. The similar form and content principle comes from design philosophy and says that the content of a work and its form (the means by which that work is created) are distinct aspects.
CSS is the most common style sheet language, though there are others for other applications. Every style sheet—the .css file created for use with one or more web pages—defines elements and properties of the associated documents with considerable flexibility. Typically, layout (such as margins, background, and headers), colors, and fonts are the basic presentation elements that are controlled.
Using CSS makes it possible to create multiple style sheets for the same website in order to render pages in different styles. The most common implementation of this is to separately render the desktop version of a website and the mobile version accessed from mobile browsers and optimized for smaller screens. Older implementations offered text-only versions of pages in order to bypass data-intensive image loading for slower Internet connections. Other implementations include rendering the page for Braille-based web browsers or speech-based browsers.
Bibliography
Applen, J.D. Writing for the Web: Composing, Coding, and Constructing Web Sites. New York: Routledge, 2013. Print.
Beaird, Jason, and James George. The Principles of Beautiful Web Design. Sebastopol: SitePoint, 2014. Print.
"CSS: Cascading Style Sheets." MDN, 19 Dec. 2024, developer.mozilla.org/en-US/docs/Web/CSS. Accessed 13 Jan. 2025.
Gandon, Fabien, and Alexandre Monnin. History of the Web: Architecture and Philosophical Engineering. New York: Wiley, 2016. Print.
Goldstein, Alexis, Louis Lazaris, and Estelle Weyl. HTML5 and CSS3 for the Real World. Sebastopol: SitePoint, 2015. Print.
Heller, Steven. 100 Ideas That Changed Graphic Design. New York: King, 2012. Print.
Lie, Hakon Wium, and Bert Bos. Cascading Style Sheets: Designing for the Web. Boston: Addison, 2005. Print.
McFarland, David Sawyer. CSS: The Missing Manual. Sebastopol: O’Reilly Media, 2015. Print.
Verou, Lea. CSS Secrets: Better Solutions to Everyday Web Design Problems. Sebastopol: O’Reilly Media, 2015. Print.
Wilson, Derren, et al. "Demonstrating and Negotiating the Adoption of Web Design Technologies: Cascading Style Sheets and the CSS Zen Garden." Internet Histories, vol. 7, no. 1, 31 Mar. 2022, pp. 27-46, doi.org/10.1080/24701475.2022.2055274. Accessed 13 Jan. 2025.