121 The History of CSS — How the Web Learned to Separate Content From Design

The Technologies That Built the Web

HTML gave the web structure.

JavaScript gave the web behavior.

But there was another problem.

How should a webpage look?

What font should it use?

What color should the text be?

How wide should the page be?

Where should an image appear?

How should columns be arranged?

What should happen when the screen becomes smaller?

Today we immediately think of CSS.

But the original web did not have CSS.

Web designers had to improvise.

And improvise they did.

The Original Web Was About Documents

When Tim Berners-Lee created the World Wide Web, the primary goal was sharing information.

HTML described the structure of a document.

A heading was a heading.

A paragraph was a paragraph.

A link was a link.

The browser decided much of the presentation.

This made sense.

The early web was much closer to a network of interconnected documents than the visual publishing environment we know today.

The Browser Controlled the Appearance

Early HTML told the browser what something was more than exactly how it should look.

The browser had default styles.

Headings appeared larger.

Paragraphs had spacing.

Links were recognizable.

The exact presentation could vary between browsers and computers.

That was not necessarily considered a problem.

The information was the important part.

Then People Wanted Design

As the web moved beyond universities and research institutions, businesses, publishers, designers, and individuals began creating websites.

They did not merely want to publish information.

They wanted identity.

They wanted branding.

They wanted typography.

They wanted colors.

They wanted columns.

They wanted precise positioning.

They wanted the web to look designed.

HTML was never intended to handle all of those jobs.

Presentation Creeps Into HTML

Browser makers responded by adding presentation-oriented HTML features.

Web developers gained ways to specify things such as fonts, colors, alignment, and backgrounds directly inside HTML.

One of the most memorable examples was the <font> element.

A developer could specify the typeface, size, or color directly in the document.

It worked.

But it created a larger architectural problem.

Content and presentation were becoming tangled together.

The <font> Tag Era

Imagine a website containing hundreds of pages.

If font instructions were repeated throughout every document, changing the site's appearance could mean editing hundreds or thousands of individual pieces of HTML.

The larger the site became, the worse the problem became.

The web needed a way to say:

“All elements of this type should look like this.”

Better yet:

“The entire website should follow these presentation rules.”

Håkon Wium Lie

In 1994, Håkon Wium Lie proposed a system for styling web documents while working with Tim Berners-Lee at CERN.

His proposal became the foundation of what we now call Cascading Style Sheets.

Other style-sheet proposals were also being explored during this period.

The challenge was not simply inventing a way to specify colors and fonts.

The challenge was creating a system that fit the unusual nature of the web.

Why “Cascading”?

The word cascading is one of the most important parts of CSS.

Web presentation can come from several places.

The browser has default styles.

The website author provides styles.

The user may have preferences or styles of their own.

Multiple rules may apply to the same element.

CSS needed a systematic way to determine which rule wins.

That process became the cascade.

The Web Is Not a Printed Page

This was a profound design decision.

On a printed page, the publisher controls almost everything.

The physical page has a known size.

The fonts can be controlled.

The layout can be fixed.

The reader cannot suddenly make the paper twice as wide or enlarge all the text.

The web is different.

A webpage may be viewed on different screens, with different fonts, different browser settings, different operating systems, and different user needs.

CSS needed to accommodate that flexibility.

CSS1

The World Wide Web Consortium, or W3C, was created in 1994 to help develop open web standards.

CSS became one of those standards.

In December 1996, CSS Level 1 became a W3C Recommendation.

CSS1 provided capabilities involving fonts, colors, text properties, backgrounds, spacing, borders, and other presentation features.

By today's standards, it was limited.

But the fundamental idea was revolutionary.

Presentation could be separated from the HTML document.

One Style Sheet, Many Pages

An external style sheet created an enormous practical advantage.

Instead of repeating presentation instructions throughout every page, a website could link multiple pages to the same CSS file.

Change the style sheet.

Change the entire website.

That was a dramatic improvement in maintainability.

HTML Describes What It Is

The ideal became clearer.

HTML should describe the content and structure.

CSS should describe its presentation.

Instead of saying:

“Make this text large, bold, and blue.”

HTML could say:

“This is a heading.”

CSS could then determine how headings should appear.

This separation became one of the foundational principles of modern web development.

But Browser Support Was a Mess

There was one major problem.

A standard is only useful when browsers implement it correctly.

During the browser wars of the late 1990s, Netscape Navigator and Microsoft Internet Explorer competed aggressively.

CSS support varied between browsers.

Some properties were unsupported.

Some were implemented differently.

Some contained bugs.

A layout that looked correct in one browser might break badly in another.

The Browser Wars Strike Again

As we saw with JavaScript, browser competition produced both innovation and chaos.

Browser companies sometimes introduced proprietary features rather than waiting for standards.

Developers were forced to test pages in multiple browsers.

Workarounds accumulated.

Browser-specific code became common.

Web development often meant discovering which browser behaved differently and finding a way around it.

CSS2

CSS Level 2 became a W3C Recommendation in 1998.

It greatly expanded the styling model.

CSS2 included more sophisticated positioning, media types, generated content, improved font handling, and other capabilities.

The web was moving toward genuine layout control.

Unfortunately, browser implementation still lagged behind the standards.

Tables Become a Layout System

Meanwhile, web designers needed layouts that worked.

HTML tables were intended for tabular information—rows and columns of related data.

But tables had one very useful characteristic:

Browsers could lay them out predictably.

Designers realized they could place an entire webpage inside a table.

A cell could hold the navigation.

Another could hold the main content.

Another could create a sidebar.

Nested tables could create increasingly complicated designs.

Tables became the unofficial layout system of the web.

The Table Layout Era

For years, many professional websites were essentially elaborate arrangements of HTML tables.

They worked.

But there were costs.

The HTML became complicated.

Content and layout became deeply intertwined.

Accessibility could suffer.

Changing the design could require substantial changes to the HTML.

And tables were being used for a purpose they had never been designed to serve.

The Spacer GIF

One of the most memorable tools of early web design was the spacer GIF.

A tiny transparent image could be given a particular width or height to force part of a table layout into position.

Need twenty pixels of space?

Put a transparent image there and make it twenty pixels wide.

It sounds absurd today.

At the time, it solved real problems.

Web developers were building visual layouts without a proper layout language.

We Were Using Whatever Worked

This period of web development is easy to criticize in hindsight.

But developers were solving problems with the tools available to them.

Tables, transparent GIFs, HTML presentation attributes, and other techniques were not used because developers misunderstood the web.

They were often used because browsers did not yet provide reliable alternatives.

Sometimes a workaround is simply the bridge between what technology can do today and what it will be able to do tomorrow.

The Box Model

CSS introduced a fundamental concept known as the box model.

Elements can be understood as boxes consisting of:

This sounds straightforward.

But inconsistent browser interpretations of dimensions and the box model became a major source of frustration.

Internet Explorer famously handled aspects of the box model differently from the standards model in older versions.

Developers created hacks and special rules to compensate.

CSS Hacks

A strange art developed around browser bugs.

Developers discovered unusual combinations of CSS syntax that one browser would interpret while another would ignore.

Those differences could be used intentionally to send different rules to different browsers.

It was clever.

It was also a sign that something was wrong.

A web standard should ideally allow developers to write one set of rules and expect browsers to interpret them consistently.

Standards Become More Important

Web developers and standards advocates increasingly pushed browser companies toward better standards compliance.

The message was simple:

Developers should be able to write to the standard rather than write separately for every browser.

Over time, browser implementations improved.

The web slowly moved away from the worst browser-specific practices.

DOCTYPE and Standards Mode

Browsers faced another problem.

Millions of existing websites depended upon older browser behavior.

Simply fixing every old behavior could break those sites.

Browsers developed different rendering modes.

A properly constructed document could trigger standards mode.

Older pages could sometimes be rendered using a compatibility mode often called quirks mode.

The web had to move forward without destroying too much of its past.

CSS Layout Begins to Replace Tables

As browser CSS support improved, developers increasingly attempted to build page layouts using CSS rather than HTML tables.

Floats became one of the primary tools.

The CSS float property had originally been intended largely for effects such as allowing text to flow around an image.

Developers discovered that floats could also create columns.

Once again, web developers adapted an available tool to solve a problem larger than the one for which it had originally been designed.

The Float Layout Era

CSS float layouts represented progress.

Content could remain more independent from presentation.

HTML could become cleaner.

Style sheets could control columns and positioning.

But floats were not really a complete page-layout system.

Developers encountered collapsing containers, clearing problems, equal-height column difficulties, and countless other complications.

The famous clearfix became part of the web developer's vocabulary.

CSS Was Growing Up

Despite the frustrations, CSS was steadily taking responsibility away from HTML.

Fonts belonged in CSS.

Colors belonged in CSS.

Spacing belonged in CSS.

Borders belonged in CSS.

Backgrounds belonged in CSS.

Increasingly, layout belonged in CSS.

HTML could return to describing the document.

CSS3 Changes the Development Model

As CSS continued evolving, the idea of one enormous specification called “CSS3” became less practical.

CSS development was divided into modules.

Different areas of CSS—selectors, backgrounds, fonts, layout, animations, transforms, and others—could evolve somewhat independently.

This modular approach allowed CSS to grow continuously rather than waiting for one gigantic new version.

Rounded Corners Without Images

Some CSS improvements seem small today but felt liberating when they became widely available.

Rounded corners are a good example.

Designers once created rounded boxes using multiple images and complicated HTML structures.

Then CSS gained reliable border-radius support.

A job that once required image editing and extra markup could be accomplished with a simple style rule.

CSS was gradually eliminating entire categories of design hacks.

Shadows, Gradients, and Transparency

The same happened with other visual effects.

Drop shadows once required images.

Gradients often required background graphics.

Transparency could require specially prepared image files.

Modern CSS gained native capabilities for many of these effects.

Pages could become visually richer while requiring fewer image files and less complicated markup.

Vendor Prefixes

During another transitional period, browser companies implemented experimental CSS features using vendor prefixes.

Developers encountered properties beginning with names such as:

-webkit-

-moz-

-ms-

-o-

The idea was to allow browsers to experiment with developing features before the standards were finalized.

In practice, developers sometimes found themselves writing several versions of the same rule.

It felt uncomfortably similar to the browser-specific coding problems the standards movement had been trying to eliminate.

Write It to the Standard

As standards matured and browser compatibility improved, the need for many vendor-prefixed rules declined.

Modern development increasingly returned to the goal developers had wanted all along:

Write the standard CSS and let standards-compliant browsers interpret it.

There are still situations where compatibility must be checked, but the modern web is dramatically better in this respect than the browser-war era.

The Mobile Web Changes Everything

For much of the early web, designers could make assumptions about screen sizes.

Many sites were designed around widths such as 640, 800, or 1024 pixels.

Then phones became serious web-browsing devices.

A fixed-width desktop layout was suddenly being displayed on a tiny screen.

The web needed to become flexible.

Responsive Web Design

In 2010, Ethan Marcotte popularized the term Responsive Web Design.

The central idea was that one website could adapt to different screen sizes rather than requiring completely separate desktop and mobile websites.

Responsive design combined several ideas:

The page could respond to the environment in which it was being viewed.

Media Queries

Media queries allowed CSS to apply different rules under different conditions.

A wide screen could use a multi-column layout.

A narrower screen could reorganize those columns.

A phone could display a simpler vertical layout.

The content remained the same.

The presentation adapted.

This fit beautifully with the original philosophy of separating content from presentation.

The Web Was Never Really a Fixed Page

Responsive design also forced designers to reconsider an assumption inherited from print.

A webpage does not have one fixed physical size.

The visitor controls part of the environment.

The screen varies.

The window varies.

The font size may vary.

The orientation may change.

The user may zoom.

Good web design works with that flexibility rather than fighting it.

Relative Units Become More Important

CSS has long provided multiple ways to specify dimensions.

Pixels are useful, but they are not always the best choice.

Relative units such as percentages, em, and rem allow designs to respond more naturally to context and user preferences.

This became increasingly important for responsive design and accessibility.

Flexbox

For years, developers used tables and then floats to create layouts because CSS lacked a system specifically designed for many common layout tasks.

Flexbox changed that.

The CSS Flexible Box Layout system was designed specifically to arrange elements along a row or column.

It could distribute space.

It could align items.

It could center things.

It could reorder and resize elements according to available space.

Problems that once required clever hacks suddenly had direct solutions.

Finally, We Can Center It

Centering an element both vertically and horizontally was once a surprisingly famous CSS challenge.

Developers invented numerous techniques depending on what was being centered and what dimensions were known.

Flexbox made many of those cases straightforward.

Sometimes technological progress is measured not by an enormous new capability but by finally making an obvious task easy.

CSS Grid

If Flexbox provided a powerful one-dimensional layout system, CSS Grid provided a genuine two-dimensional layout system.

Grid allows developers to define rows and columns and place content within them.

For the first time, CSS had a layout system specifically designed for the kinds of page structures developers had been trying to create since the table-layout era.

This represented an extraordinary change.

The web finally had a real layout language.

From Tables to Grid

Consider the progression:

HTML tables → spacer GIFs → CSS floats → Flexbox → CSS Grid

Each step reflects the web gradually developing tools specifically designed for the job developers were trying to accomplish.

The old techniques were not foolish.

They were solutions to problems the platform had not yet learned how to solve properly.

CSS Variables

CSS also gained custom properties, commonly called CSS variables.

A developer can define a value once and reuse it throughout a style sheet.

Colors, spacing values, font settings, and other design choices can be managed more systematically.

Changing one variable can update many parts of a design.

This moves CSS closer to a reusable design system rather than merely a collection of isolated styling instructions.

CSS Can Calculate

Modern CSS can also perform calculations.

Functions such as calc() allow values to be derived from other dimensions.

Functions such as min(), max(), and clamp() provide even more responsive control.

A design can establish limits while still adapting fluidly between them.

This is especially useful for modern responsive typography and spacing.

From Fixed Font Sizes to Fluid Typography

Typography illustrates how far CSS has come.

Early web pages might specify a font size directly in HTML.

Later CSS moved those values into style sheets.

Relative units such as rem improved scalability.

Modern functions such as clamp() can allow typography to grow smoothly with the viewport while maintaining sensible minimum and maximum sizes.

The result can be both responsive and accessible.

CSS and Accessibility

CSS gives designers enormous control, but that control must be used carefully.

Text can be made too small.

Color contrast can become inadequate.

Focus indicators can be hidden.

Content can be visually rearranged in ways that do not match its logical reading order.

Fixed dimensions can interfere with text enlargement.

Good CSS does not merely make a page attractive.

It helps the page remain usable under different conditions and for different people.

User Preferences Return to the Story

Interestingly, modern CSS increasingly acknowledges something that was part of the web's original philosophy:

The user has preferences too.

CSS can respond to preferences such as reduced motion or light and dark color schemes.

Browsers can respect zoom and font-size choices.

The website author controls much of the design, but not necessarily every detail of the visitor's experience.

The cascade was designed for a world where control could be shared.

CSS Animations and Transforms

Visual effects that once required JavaScript or plugins can increasingly be performed directly by CSS.

Elements can transition smoothly between states.

They can move, rotate, scale, and transform.

Animations can be defined in CSS.

This reinforces an important principle:

If CSS can perform a presentation task well, JavaScript may not be necessary.

CSS Reduced the Need for JavaScript

The relationship between CSS and JavaScript has evolved.

Early developers sometimes used JavaScript to produce visual effects because CSS could not.

Modern CSS can handle many hover effects, transitions, animations, responsive layouts, menus, visual states, and other presentation tasks.

JavaScript can then concentrate on behavior that genuinely requires programming.

The layers become cleaner.

HTML, CSS, and JavaScript Find Their Roles

After decades of experimentation, the three core browser technologies developed increasingly clear responsibilities.

HTML — structure and meaning.

CSS — presentation and layout.

JavaScript — behavior and interactivity.

They overlap in places.

But understanding those roles helps produce websites that are simpler, more maintainable, and more accessible.

CSS Became a Programming-Like Language

CSS is not generally described as a traditional programming language.

But modern CSS is far more sophisticated than a simple list of colors and font sizes.

It has variables.

It performs calculations.

It evaluates environmental conditions.

It responds to screen characteristics and user preferences.

It creates complex layouts.

It performs transitions and animations.

It contains an increasingly powerful system of selectors and relationships.

The humble style sheet grew into a remarkably capable language for describing responsive visual systems.

CSS Frameworks

As websites became more complex, developers also created CSS frameworks.

Frameworks such as Bootstrap provided predefined grids, buttons, forms, navigation components, spacing systems, and responsive behaviors.

These tools allowed developers to create consistent interfaces quickly.

Other approaches and frameworks followed.

As with JavaScript frameworks, they can be extremely useful.

But they are additional layers, not requirements of CSS itself.

Do We Need a CSS Framework?

Once again, the right question is:

What problem are we trying to solve?

A large application with many developers may benefit greatly from a shared design framework.

A smaller custom website may be simpler and more distinctive with carefully written CSS of its own.

There is no prize for using the greatest number of technologies.

The goal is a website that works well.

The Browser Wars Slowly Give Way to Standards

Modern browsers still have differences.

New features still appear at different times.

Testing remains important.

But the situation is dramatically better than it was during the 1990s and early 2000s.

Web developers can increasingly write standards-based CSS and expect modern browsers to interpret it consistently.

That represents decades of work by standards organizations, browser developers, and the web-development community.

From Spacer GIFs to Grid

Perhaps nothing captures the history of CSS better than comparing two eras.

In one era, a developer might use an invisible GIF image inside a nested HTML table simply to create a particular amount of empty space.

Today CSS can create responsive two-dimensional layouts that automatically adapt to available space, screen size, typography, and user preferences.

That is an extraordinary amount of progress.

The Workaround Becomes History

One of the fascinating patterns in web development is that today's workaround can become tomorrow's historical curiosity.

Spacer GIFs solved real problems.

Table layouts solved real problems.

Floats solved real problems.

Vendor prefixes solved real problems.

But eventually the web platform developed better solutions.

Good developers adapt when the platform gives them a simpler and more appropriate tool.

The Technology Can Become Invisible Without Becoming Unimportant

A visitor rarely thinks about CSS.

They simply see a page that looks good.

The navigation fits the screen.

The text is readable.

The columns rearrange themselves on a phone.

The spacing feels comfortable.

The images scale properly.

The page responds when the visitor changes the size of the window.

When CSS is doing its job well, the visitor may never think about it at all.

Once again:

The technology can become invisible without becoming unimportant.

From Decoration to Architecture

CSS began largely as a way to control the presentation of HTML documents.

It became something much larger.

It became the layout system of the web.

It became a responsive-design system.

It became a typography system.

It became an animation system.

It became part of accessibility.

It became part of adapting websites to phones, tablets, desktops, large displays, printers, and user preferences.

CSS did not merely make the web prettier.

CSS helped the web learn how to adapt.

Next: CSS Today and Tomorrow

Modern CSS can do things that would have seemed almost impossible during the table-layout era.

Flexbox and Grid provide real layout systems.

Custom properties create reusable design systems.

Media queries respond to screens and devices.

Container queries allow components to respond to their own available space.

Functions such as clamp() create fluid typography and spacing.

Modern selectors can describe relationships that once required JavaScript.

CSS can respond to user preferences, animate interfaces, control complex layouts, and increasingly adapt components automatically.

And artificial intelligence may soon make sophisticated CSS easier to create, understand, test, and maintain.

Next in The Technologies That Built the Web, we will explore CSS Today and Tomorrow—and see how a technology originally created to separate fonts and colors from HTML became one of the most powerful and surprisingly intelligent parts of the modern web platform.

Home
Brad Zehr | Zehr.net | brad@zehr.net

About Services Why A Site Site Ideas Topics Podcast Help Contacts

Topics, Podcast & Images on this site are AI Assisted.

Search Contact Home