We are independent & ad-supported. We may earn a commission for purchases made through our links.

Advertiser Disclosure

Our website is an independent, advertising-supported platform. We provide our content free of charge to our readers, and to keep it that way, we rely on revenue generated through advertisements and affiliate partnerships. This means that when you click on certain links on our site and make a purchase, we may earn a commission. Learn more.

How We Make Money

We sustain our operations through affiliate commissions and advertising. If you click on an affiliate link and make a purchase, we may receive a commission from the merchant at no additional cost to you. We also display advertisements on our website, which help generate revenue to support our work and keep our content free for readers. Our editorial team operates independently from our advertising and affiliate partnerships to ensure that our content remains unbiased and focused on providing you with the best information and recommendations based on thorough research and honest evaluations. To remain transparent, we’ve provided a list of our current affiliate partners here.

What are Cascading Style Sheets?

By Brendan McGuigan
Updated May 17, 2024
Our promise to you
WiseGEEK is dedicated to creating trustworthy, high-quality content that always prioritizes transparency, integrity, and inclusivity above all else. Our ensure that our content creation and review process includes rigorous fact-checking, evidence-based, and continual updates to ensure accuracy and reliability.

Our Promise to you

Founded in 2002, our company has been a trusted resource for readers seeking informative and engaging content. Our dedication to quality remains unwavering—and will never change. We follow a strict editorial policy, ensuring that our content is authored by highly qualified professionals and edited by subject matter experts. This guarantees that everything we publish is objective, accurate, and trustworthy.

Over the years, we've refined our approach to cover a wide range of topics, providing readers with reliable and practical advice to enhance their knowledge and skills. That's why millions of readers turn to us each year. Join us in celebrating the joy of learning, guided by standards you can trust.

Editorial Standards

At WiseGEEK, we are committed to creating content that you can trust. Our editorial process is designed to ensure that every piece of content we publish is accurate, reliable, and informative.

Our team of experienced writers and editors follows a strict set of guidelines to ensure the highest quality content. We conduct thorough research, fact-check all information, and rely on credible sources to back up our claims. Our content is reviewed by subject matter experts to ensure accuracy and clarity.

We believe in transparency and maintain editorial independence from our advertisers. Our team does not receive direct compensation from advertisers, allowing us to create unbiased content that prioritizes your interests.

Cascading Style Sheets are documents used in tandem with another document to dictate the stylistic presentation of data. Cascading Style Sheets are often referred to by the initials "css," and play an important role in modern web design. While Cascading Style Sheets may be used with any sort of structural XML document, the overwhelming bulk of their use is for giving stylistic instructions to XHTML and HTML pages.

Cascading Style Sheets allow a designer to separate the structural and stylistic elements of their web page completely. In the past web pages were written almost exclusively as a single HTML document. Things such as background colors, justification of text, font sizes, and borders, were all dictated within the HTML document itself. While this was, in many ways, a common-sense way to handle design, it was by no means the most efficient.

A truly structural HTML or XHTML document possesses none of these features. It contains semantic codes, indicating what sections of text are intended to be headers, which are intended to be emphasized or stronger, and which are meant to be basic paragraphs — but the actual presentation of this information is left undefined. Of course, it is important to note that most web browsers have basic Cascading Style Sheets that they apply to any page without its own — rendering text within <strong> tags as a certain weight of bold, for example, or text within the <h1> header tag

as a certain size and weight.

Once a page has been built structurally, with the relevant semantic tags, and labels applied to important tags — given either as classes or IDs — it is time for one or more Cascading Style Sheets to be applied. The sheets are referred to in the header of the HTML or XHTML document, and can have values there assigned to them, such as a specific name, or a specialized type — e.g. defining a sheet to be used exclusively when the webpage is printed.

Cascading Style Sheets can then define all of the stylistic bits of the web page, referencing them by tag type, class or ID, or by their location in the data structure of the page. Using Cascading Style Sheets, a designer can define fonts, colors, positions, borders, hover effects, sizes of elements, visibility, and much more.

Unlike the older model, where each page had to contain all of its own stylistic definitions, with Cascading Style Sheets, all the style for an entire site can be contained in one document. This has a number of large benefits. To begin with, file sizes are usually drastically reduced — the larger the site, the larger the savings, as all the styles are being loaded only once, rather than one time for each page. A site built with Cascading Style Sheets also tends to be much easier to update, as the code that needs to be changed is much less. For example, under the older model, in order to change the font size of the copyright line at the bottom of each page, one would have to go through and manually edit every page in the site — for a large site, this could be many thousands of lines of code. Using Cascading Style Sheets, however, only a single line need be edited in one document, and the change would take effect over the entire site.

Cascading Style Sheets are becoming more and more widely used, with the advent of better implementation in popular browsers, a more wide-spread acceptance of Web Standards as a whole, and as mainstream web design programs begin using them more. Overall, most would agree that Cascading Style Sheets can make a designer's life much easier, and make for a faster, cleaner Internet for all.

WiseGEEK is dedicated to providing accurate and trustworthy information. We carefully select reputable sources and employ a rigorous fact-checking process to maintain the highest standards. To learn more about our commitment to accuracy, read our editorial process.

Discussion Comments

WiseGEEK, in your inbox

Our latest articles, guides, and more, delivered daily.

WiseGEEK, in your inbox

Our latest articles, guides, and more, delivered daily.