It’s late 1996, and web development has become a nightmare of nested tables, <font color="#FF0000"> tags, and invisible 1-pixel spacer GIFs. We’ve been using HTML (a structural language) to handle visual design, and it’s a mess. The code is bloated, hard to maintain, and completely inaccessible.
Enter Cascading Style Sheets (CSS) Level 1.
The Vision
The idea is simple but revolutionary: keep your content in the HTML and your design in a separate CSS file. Want all your headings to be blue and Helvetica? Change one line in your CSS instead of searching through 50 HTML files.
/* A simple CSS1 stylesheet */
body {
font-family: Arial, sans-serif;
background-color: #f0f0f0;
}
h1 {
color: darkblue;
text-align: center;
}
p {
line-height: 1.5;
margin-left: 10%;
margin-right: 10%;
}
The "Cascading" Part
The "Cascading" aspect is particularly clever. It allows styles to be defined at different levels (browser defaults, external sheets, internal blocks, inline styles) and combined according to specific rules of precedence.
The Reality Gap
As much as I love the theory, the reality is frustrating. Browser support is... let’s say "creative." Internet Explorer 3.0 has some support, and Netscape 4.0 (which just came out) has its own very different ideas about how CSS should work. If you try to use anything more complex than basic colors and fonts, your layout will likely explode in at least one browser.
Looking Ahead
We are at the beginning of a long journey. It’s going to take years for browsers to implement these standards consistently. But the potential for a cleaner, more maintainable web is worth the struggle. Someday, we’ll look back at <table> layouts and wonder what we were thinking. For now, though, I’ll keep my spacer GIFs close at hand, just in case.
Aunimeda develops websites and web applications for businesses - corporate sites, e-commerce, portals, and custom platforms.
Contact us to discuss your web project. See also: Web Development, E-commerce Development