Ask Håkon About CSS or...? 326
Back in 1994, while working for the World Wide Web Consortium (W3C), Håkon Wium Lie (pronounced more or less "how come") proposed the idea of Cascading Style Sheets (CSS). Got a CSS question? An Ajax question? Want to know why Håkon loves Free Software so much? Or something else, related or not? Go ahead and ask -- after checking some of the links above, so you don't duplicate questions he's answered in other interviews or in articles he's written. (One question per post, please.) We hope to post his answers Friday.
Re:Just one question (Score:0, Informative)
Better than you, apparently.
(pro tip: The second-person past-tense form of be is were.)
Re:Where... (Score:1, Informative)
Re:Pronunciation (Score:5, Informative)
Re:Padding (Score:5, Informative)
Re:Included styles, aliases (Score:3, Informative)
For example, rather than define a variable and use it in style declarations throughout the document, you simply define one property of multiple selectors at once.
So rather than
H1 {color: col1; other-styles-here}
PRE {background-color: col1; other-styles-here}
you would, instead, write
H1, PRE {color: blah}
H1 {other-styles-here}
PRE {other-styles-here}
Now, it's not quite as elegant since it would separate logically-related style groups by forcing together selectors that happen to share some property, rather than keeping selectors together based on semantic usage (say, all your navigation bar-related styles in one big group). But it does work.
If you read Lie and Bos, it's clear they've put a lot of thought into why things are the way they are, and if it's difficult in some ways there's a good reason for it somewhere else. At least, that's been my experience.
Re:CSS for table columns? (Score:3, Informative)
You can (<col class="whatever">). However, the instant you add classes to any of the rows or cells in the table, it stops working, so it's not very useful.
Re:Why is CSS such a good idea but a pain to use? (Score:3, Informative)
If you're just making static pages for personal use, go ahead and do whatever. The primary goal of stylesheets isn't to make layout easy (obviously...) it's to break down elegantly on non-standard devices. A good CSSed document will be inteligeable if all formatting gets turned off and it just reads as a long page of text.
While the language has its problems, MOST of the complaints seem to come from people who want to put their heads in the sand and pretend like it's 1998 and all you need to do is make sure your page renders at 800x600 on two browsers and you're done. The web's a bigger place than that now, and the technology has by necessity gotten more complicated.
Re:Why is CSS such a good idea but a pain to use? (Score:3, Informative)
I'm all for separating markup from layout, but it simply doesn't work right yet.