
CSS is 20 years old today. Interview with Haakon Wiom Lee (Part 1)
- Transfer

It was twenty years ago today
That Håkon wrote a doc to say
That if the Web's gonna last a while
Then we need a way to define style.
So may I introduce to you
a way to add visual treats:
It's Sergeant Håkon's Cascading Style Sheets!
But, when we got to Paul’s home and asked him to sing this song for us, he refused and sent down dogs called FontTag and Bgcolor on us. Therefore, to mark such a round date, we went to Haakon and asked him a few questions about the past, present and future of CSS.
You came up with CSS 20 years ago. Are you satisfied with how your brainchild grew?
Yes, I am very pleased. CSS is the cornerstone of web standards, and it makes pages look more beautiful. The fact that HTML itself is still alive and thriving is also possible due to the success of CSS. But, as is always the case with youth, there is still room to grow.
People often quote your words that you suggested CSS to save HTML. Explain this idea, please.
HTML would be completely different if not for CSS. Layout designers with experience in the desktop environment, including myself, came to the web and were completely baffled by the lack of tags
In the original version of the specification was proposed mechanism to specify the "influence" that looked like this:
h1.font.size = 24pt 100%
. The following logic was supposed to work:The percentage value at the end of the line sets the desired level of influence (here - 100%). If this is a top-level style sheet (that is, it is under the complete control of the user), the request for the level of influence can be fully satisfied, for example, all headers will be displayed in Helvetica font. If the level of influence is requested in the subordinate styles, it is satisfied to the extent that the higher ones allow.
Why was this mechanism abandoned?
It was proposed to find a compromise between the preferences of the author of the document and readers. The idea from MIT Media Lab served as an inspiration - in the future, televisions should have regulators that control not only brightness and color, but also levels of sex and violence, or, say, left and right political views. The influence mechanism involved the creation of such a “slider” at one end of which the author completely controlled the display of the document, and the reader at the other. And the browser had to mix their preferences in a given proportion, so that everyone was happy. This worked well for some properties (e.g.
font-size
), but created problems for others (e.g. font-family
). In the first response to a CSS proposal, Bert Bos criticized this idea:The idea that the two design options can be mixed, leading to a certain middle style, seems to me completely wrong. What happens if my blue text on a yellow background is mixed with someone's favorite yellow on blue? Green on green? Or imagine a page with headings typed in avant-garde decorative fonts and paragraphs of text typed by Helvetica.
I answered :
Some attributes mix better than others. A typical case of using a “weighted average” is to mitigate the author’s attempts to isolate something, for example by changing the font size, and at the same time bring his thought to the reader. No one is obliged to use this opportunity, but even though “100%” is no different from the binary unit, binary logic leaves no room for maneuver. Computer interfaces in general seem to me too binary.
Of course, Bert was right (he is right almost always) that this proposal creates more problems than it solves, and he had to refuse it.
The same question about writing property names through dots, in JavaScript style. Why was it abandoned?
Interestingly, you call it a "JavaScript style." When I wrote my sentence, JavaScript was not yet invented, so I could not get this syntax from there. In fact, X-resources from the X Window System, another project from MIT, served as a source of inspiration .
There were two reasons CSS syntax moved from
font.size
to font-size
. First, the hyphen made the code look more like plain text in English, that is, more readable. Secondly, in DSSSL and DSSSL-Liteproperty names were written exactly with a hyphen. James Clark, who wrote the first draft of DSSSL-Lite, participated in the first W3C style sheet conference , and Bert and I borrowed a hyphen from DSSSL. But this syntax has a drawback - a hyphen is used as a minus sign, which can confuse the parser. How did Bert Bos get involved in the project, and how did you work together?
Bert Bos wrote a review on my original proposal. His experience and interests were slightly different from mine, but when he published his own proposal , we quickly realized that both options needed to be combined. Just at that time, CERN transferred the web into the public domain and a W3C consortium was formed. I was involved in setting up a W3C branch in INRIAand immediately hired Bert. Most of the CSS1 standard was born on a whiteboard in the Sophia Antipolis technology park. Until now, fighting another difficult technical problem, I dream that Bert and this board would be near.
Listing the people who made CSS a reality, I should also mention Thomas Reardon and Chris Wilson of Microsoft. Thomas was the director of Internet Explorer, and from the very beginning he got the idea of making style sheets part of the web. Chris Wilson is a programmer who has been implementing CSS in IE3. The implementation of CSS in IE3 was quite far from the standard, but we must not forget that this browser came out before the CSS1 specification was completed. Simon Daniels (also from Microsoft) wrote some impressive demos for IE3, and the three of them convinced the leading software company to support the young standard.
Were there any alternative offers? How was yours better?
There were about a dozen alternative syntax suggestions. But not all of them were suitable for use on the web because of its specificity. For example, browsers render the document sequentially as they load, and should be able to do this even if styles are not yet available. In addition, there are many different devices on the Internet, and you cannot write a separate style sheet for each of them. So a style language must support a scalable and responsive design. This is an exciting topic for research, I even defended a dissertation in which I compared different approaches to organizing style sheets.
Of course, the second question I can not answer with an open mind. I’m sure that there are several points in CSS that make the language especially suitable for use on the web: cascading, pseudo-classes and pseudo-elements, parsing rules with direct compatibility, support for different types of media, emphasis on the use of selectors and, of course, the unit of measure
em
. What was your (and Bert's) biggest mistake?
In my dissertation, an entire section is devoted to CSS flaws. Yes, they are, including through our fault. But the biggest problem of the first version was not the design of the language itself (in my opinion, it is pretty good), but its implementation in browsers. Jeffrey Zeldman described the situation well:
If Netscape 3 ignored the CSS rules for the elementand added arbitrary fields to the structural elements of the page, and IE4, although it worked
correctly, was confused with
padding
how to write CSS code? Some developers preferred not to write it at all. Others wrote one file with IE4 flaws, and the other with hacks for Netscape 4.
Of course, part of the blame lies with Microsoft and Netscape, but we - Bert, W3C - and I could have avoided many problems if we had published not only the specification , but also the test suite from the very beginning . The first true CSS test only appeared in October 1998, when Todd Farner published the Acid test . The test was unusual and visual - developers could immediately understand whether the browser passes the test or not. In the beginning, not a single browser could pass it. But then, under strong pressure from the CSS community, things started to improve. WaSP Projectplayed a key role in improving standards support. The Opera browser also contributed, showing that it is possible to implement CSS correctly. When I saw how well Opera supported CSS (much better than Microsoft and Netscape), I joined Opera.
Prior to this, one of Opera's chips was that their browser fit on a single floppy disk (1.44 MB). In those days, the phrase "fit on a floppy disk" was a cool advertising slogan. With the addition of CSS, one floppy disk was missing. “Almost fits on a floppy disk” sounded not so cool anymore.
The original Acid test became a model for Acid2 and Acid3 , which followed the same recipe: a web page with a cunning layout, which immediately shows how well many features of the language are supported. The impetus for the development of Acid2 wasBill Gates' open letter , where he warmly spoke in support of compatibility. Making IE7 standards compliant seemed like the logical next step, and Acid2 was our challenge to Microsoft . Honestly, other browsers also had problems, and Acid2 found errors in all of them. Microsoft ignored Acid2 in IE7, but - miracles sometimes happen - IE8 passed it flawlessly. Like all modern browsers.
Second part