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.
Does your name... (Score:3, Funny)
Idea? (Score:2, Interesting)
Re:Idea? (Score:5, Funny)
Re:Idea? (Score:2)
Love of free software (Score:4, Funny)
Well...Håkon?
Re:Love of free software (Score:2)
Re:Love of free software (Score:2)
Why? (Score:5, Funny)
Because of America harbors ursine evil. (Score:5, Funny)
Because America is known to harbor bears, godless killing machines without a soul that are a threat to free men everywhere. If you harbor bears you are bears.
Put a stop to America's bearrorism today. [petitionspot.com]
Re:Because of America harbors ursine evil. (Score:2, Offtopic)
But not the Cub Scouts. They're bear funders and sympathizers. America has no need of their brand of extremists.
Re:Because of America harbors ursine evil. (Score:5, Funny)
Re:Because of America harbors ursine evil. (Score:3, Funny)
Re:Why? (Score:2)
Where... (Score:3, Interesting)
Re:Where... (Score:5, Interesting)
OK, here's my related question:
Do you think the W3C development process is too slow? I know that you guys want everything to be perfect, but it seems to take far longer than necessary. CSS 3 shows promise and I wouldn't want it to die a slow death in standardization.
Opera (Score:5, Interesting)
Re:Opera (Score:3, Funny)
Translation: I like Opera, please give them your blessings so that I may sleep at night.
I have one (Score:3, Funny)
And another (Score:2, Interesting)
Padding (Score:5, Interesting)
Re:Padding (Score:5, Interesting)
Re:Padding (Score:2)
Re:Padding (Score:2)
Or at least, that's how the logic behind the decision supposedly goes.
Re:Padding (Score:5, Informative)
Re:Padding (Score:3, Insightful)
No, really! -- a slashdot editor wrote this! (Score:5, Funny)
Duplicates? On Slashdot? Surely you jest, sir!
Re:No, really! -- a slashdot editor wrote this! (Score:2)
Re:No, really! -- a slashdot editor wrote this! (Score:5, Funny)
Re:No, really! -- a slashdot editor wrote this! (Score:2)
Why is CSS such a good idea but a pain to use? (Score:5, Interesting)
Why is CSS such a pain compared to other languages?
Re:Why is CSS such a good idea but a pain to use? (Score:4, Insightful)
It's really not that bad once you get on to it. It would be nice if it could do math to calculate positions/sizes/etc., and supported multiple backgrounds for a single element, ala Safari. But all in all, it's poor browser support that really makes CSS difficult.
Re:Why is CSS such a good idea but a pain to use? (Score:3, Interesting)
But there are cases where CSS cannot perform layout as well as tables. One of the reasons is because you can center a table that is sized to fit the content. In other words, in CSS you need to specify the size of the container in order to "auto" the margin
Re:Why is CSS such a good idea but a pain to use? (Score:2)
Actually, the real question is why not float: <arbitrary function>
DSSSL had this sort of thing solved before HTML even existed, let alone CSS. But scheme is too scary and icky, and the W3C believes in a principle of least power, so CSS has to be fully declarative, static, and crippled until patched later.
Re:Why is CSS such a good idea but a pain to use? (Score:2)
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.
Re:Why is CSS such a good idea but a pain to use? (Score:2)
Yes, all KHTML-based browsers now support CSS 3 backgrounds.
Well no, CSS isn't well supported. You're making the mistake of forgetting about the entire sections of CSS that Internet Explorer doe
Re:Why is CSS such a good idea but a pain to use? (Score:5, Insightful)
- You are supposed to separate content and visual elements. An input is both.
- An HTML page has to be XML. To achieve this part of positioning is delegated to attributes.
- The belief that tables are bad. In fact they are very intuitive elements - unlike the DIVs. It would have been much better if we could do with one block element that had the strong points of both tables and divs.
- A total disregard for consistency. Every HTML page contains 3 languages for the same thing: HTML, CSS and javascript. In many cases all three use slightly different names for the same thing. It would have been much better if they had been integrated into a consistent interface.
My question for Hakon: HTML became popular because it was so simple to use that everyone could use it. CSS by contrast is so complicated that only fulltime professionals understand it. Will CSS stay an elite thing?
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
Re:Why is CSS such a good idea but a pain to use? (Score:5, Interesting)
I'd like to try to turn your observation into a more specific question:
CSS is clearly very useful for separating style from content. But apparently people tend to have problems when using it for layouts. Would you say this is because people have not yet understood how to properly do layout in CSS, or is it CSS that is lacking in this area? What can be done to improve the situation? --- Would the web benefit from HTML and CSS being complemented with some kind of "layout language"?
Re:Why is CSS such a good idea but a pain to use? (Score:4, Insightful)
Vertical centering is just as important. I want to be able to (without tables) place a 500x500 box center of the window without resorting to some wierd javascript to do it. You give me a div (or p) that does this in all browsers with zero javascript and I will be impressed.
Browser support is the other issue, and it is a killer.
That said, I love the concept and most of methods, I just hate the browser wierdness.
Re:Why is CSS such a good idea but a pain to use? (Score:4, Interesting)
Vertical centering is just as important. I want to be able to (without tables) place a 500x500 box center of the window without resorting to some wierd javascript to do it. You give me a div (or p) that does this in all browsers with zero javascript and I will be impressed.
The way I usually do it is with negative margins. It's kind of a workaround, but it does work. Position the div 50% from the top and left, and then give it a negative margin-top & margin-left equal to 1/2 its own height & width respectively (in the case of 500x500, use a -250px margin) and it should center vertically.
For example, I use something like this on one of my sites:
#container {
position: absolute;
left: 50%;
top: 50%;
z-index:1;
width: 500px;
height: 500px;
margin-left: -250px;
margin-top: -250px;
}
Re:Why is CSS such a good idea but a pain to use? (Score:3)
Data transformation a la XSLT? (Score:3, Interesting)
2.) Would it be crazy to have CSS incorporate data selection and assembly? (using something like XPath -- alowing more complete segration of data and formatting.)
Two questions (Score:2, Interesting)
Re: Two questions (Score:5, Interesting)
1. What would you most like to change with CSS? That is, if you could go back in time and change one thing in the spec and have it reflected today, what would be the most important thing?
2. If you were allowed (perhaps by court order, which wouldn't be unthinkable) to force Microsoft to do one (1) change in Internet Explorer, what would that be?
As a bonus question: What do you think of Slashdot's CSS? ;)
Re: Two questions (Score:5, Funny)
IRONY.
Re: Two questions (Score:2)
Included styles, aliases (Score:5, Interesting)
(For includes) (For aliases) This way we could change colors or images for a whole webpage by editing a reduced number of lines.
Had you considered any of these ideas in the past? If so, why were they rejected?
Re:Included styles, aliases (Score:2, Interesting)
as far as aliases, i would also love to have something like that in css. it would make it much more easy to organize your styles.
Re:Included styles, aliases (Score:2)
doesn't the "cascading" portion of "cascading style sheets" sort of take care of the includes for you? if you organize your styles right, there shouldn't really be a need for includes.
I began thinking of these ideas when I studied multi-tier programming and separation of concerns. Even thoough CSS is presentation, it can still be organized in tiers, where the complicated stuff could be seen as the logic tier, and the aliases could be seen as the presentation tier.
as far as aliases, i would also love to have
Re:Included styles, aliases (Score:2)
So here's my question: Any plans to add OOP-like syntax to CSS?
More programmically approaches of CSS (Score:3, Interesting)
ol#a *:first-child a:hover + dd, span#b *:first-child a:hover + dd {
Why is there no 'grouping' of selectors such as:
ol#a, span#b { *:first-child a:hover + dd {
And of course, there are more possibilities to greatly improve the maintainability of CSS-files; being able to define variables, or inline-calculations (eg. border-width: @var - 0.5em;
Have they not been included to keep CSS simple, or
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 forcin
CSS Evolution! (Score:5, Interesting)
Re:CSS Evolution! (Score:5, Funny)
CSS is about intelligent design, not evolution!
Horizontally aligning multiple items (Score:5, Interesting)
It's the main thing that's missing from CSS. Was it too hard to implement or write syntax for?
I'm thinking something like:
horizontal-align-to: .
eg: horizontal-align-to: #box middle top; Will align the top of this element to the middle of #box.
The same for vertical align would be nice as well. For horizontal elements restrict it to elements within a parent (and allow ID's (or use class name) to be duplicated within different parents, to make repeating multiple rows easier). For vertical it must be set on a block level element.
Alternate syntax:
On the reference element: horizontal-align-to: #name_me position;
On the to be aligned one: horizontal-align-from: #his_name position;
So:
horizontal-align-to: #rowman top;
horizontal-align-from: #rowman middle;
Will align the middle of the element, to the top of rowman.
Re:Horizontally aligning multiple items (Score:4, Interesting)
Also the top middle bottom stuff, they should take an offset: eg: middle-10px; not sure of how to write that in good CSS sytax though. And baseline, and the rest of the aligners are legal as well.
About Microsoft... (Score:5, Interesting)
equal column heights (Score:4, Interesting)
Re:equal column heights (Score:2)
They added that feature to CSS over eight years ago [w3.org]. Nobody uses it because Internet Explorer hasn't caught up to 1998 yet. No, not even Internet Explorer 7.0 will handle display: table-cell. Maybe Internet Explorer 8.0 if we are lucky.
What would you like them to do - add a duplicate feature and hope Microsoft implements
New standards (Score:5, Interesting)
Can you explain why W3C isn't sufficient, and why efforts at Opera to expand beyond the standards differ from Microsoft's embrace/extend model?
Vertical CSS Support (Score:5, Insightful)
As a developer who works with CSS every day, I find one complication that continues to bother me in my daily work. Support for CSS has always been good on the horizontal scope, but vertical positioning has always been quite complicated. Alone the procedure to affix a footer to the bottom of a screen in dependance of the amount of content is unnecessarily difficult, spawning hackish solutions such as "footerStickAlt" [themaninblue.com]. Centering an object in the dead center of a page also requires strange procedures such as this one [wpdfd.com], which still aren't ideal (try making the viewport really small). The old table method provided much easier methods for this. What are your thoughts on this and do you see improvement following in future CSS revisions?
Does CSS suck? (Score:3, Interesting)
http://www.decloak.com/Dev/CSSTables/CSS_Tables_1
"I pretty much want to kick whoever invented CSS in the nuts."
Re:Does CSS suck? (Score:2)
Re:Does CSS suck? (Score:2)
Re:Does CSS suck? (Score:2)
No, most of us are smart enough to know which tool to use for which job. It's not CSS's fault if one person happens not to be.
Some of the links:
Re:Does CSS suck? (Score:2)
That page is a long-standing joke. Surely the way it's written tipped you off? It reads like an angry thirteen year-old was let on the computer without supervision. Try googling the web or Usenet for some of the rebuttals.
Heres one (Score:2)
Zen Garden (Score:2)
Misuse and Suggestions (Score:5, Interesting)
Should CSS be a religion? (Score:5, Interesting)
I understand the impetus behind CSS, and think it has brought some nifty things to the Web, particularly in terms of integrating with the DOM and thus helping usher in all the AJAXy goodness we're seeing lately.
But CSS also seems to have spawned an anti-HTML jihad movement of people who rail against simple but effective HTML markup, including for example the B, I and FONT tags and the TABLE. Many people seem to make the principle of separating presentation from content a religious issue.
I learned HTML in 1994 by using the View Source command in Mosaic and Netscape (beta). The simplicity of the tags made it very easy. I could keep the basic structure of a doc in my head: "<html><head><title>Home Page</title></head><body><p>Hello, <b>world</b>!</body></html>"
For all the strenghts of CSS+XHTML, they are significantly more complicated to learn than basic HTML.
Do you worry that CSS is scaring off new Web writers, espeically since basic HTML is increasingly deprecated among Web developers?
Re:Should CSS be a religion? (Score:2)
Why would it scare off new web writers? I can see a case for it scaring off newbie designers but CSS actually makes it easier to write for the web, because you don't have to worry about the design so much when you are writing. In fact, surely the immense popularity of weblogs is evidence that writing for the web is more popular than ever before? It certainly doesn't look like anybody is being scared off.
Usability Testing (Score:2, Interesting)
HTML5 (Score:3, Interesting)
{Gack.} (Score:5, Interesting)
why not XML? (Score:2)
Re:why not XML? (Score:2)
Acid2 test? (Score:3, Insightful)
For your reference: http://www.webstandards.org/files/acid2/test.html [webstandards.org]
Any plans (Score:2)
I for one enjoyed that Valentine's day treat quite a bit!
Since Slashdot started with CSS (Score:2)
Question for /. (Score:2)
C'mon guys, you know grade school was hard enough for this fella.
Re:Question for /. (Score:2, Interesting)
I doubt it
As you can see from this graph [www.ssb.no], it's one of the most common names in Norway. (numbers on the left in percent)
mixing inline and block elements (Score:4, Interesting)
so, cascading style sheets... (Score:2)
Microsoft Internet Explorer (Score:2)
I mean, I know I do, and CSS isn't my baby.
Tom Caudron
http://tom.digitalelite.com/ [digitalelite.com] (why yes, it is a CSS-based 3-column layout!)
Form vs. Content (Score:2)
Definition of pixel (Score:5, Interesting)
The word pixel meant "picture element", but CSS redefined it to mean something quite different (a particular subtended angle of view [w3.org]). This causes confusion: CSS pixels are not pixels. (Indeed, I have seen misinformed comments on Slashdot due to that confusion.)
My question is this: why call the subtended angle a "pixel", instead of something else (e.g. "subangle")? If CSS wanted to use the subtended angle for something, that is fine, but calling it a pixel seems to follow the approach of Humpty Dumpty—"When I use a word, it means just what I choose it to mean".
CSS question (Score:2)
To illustrate my point of view: Positioning of block elements in CSS can only be absolute (which is not suitable for arbitrary size screens), relative to immediately preceding or following elements (which is not very flexible) or floating (which is also not very flexible as it only affects subs
AT/Browser Integraiton (Score:2)
CSS2 has some very cool properties [w3.org] for interfacing with Assistive Technology (AT) such as JAWS and WebEyes.
For unfamiliar readers, the speak selector could be used with amazing effectiveness, eg:
speak:spell-out;
}
<abbr title="Strucuted Query Language">SQL</abbr> is very popular in the <abbr title="United States" class="initialism">US</abbr>
Unfortunately, implementation of these features does not seem to be a high priority for AT manufacturers. What efforts, if
CSS for table columns? (Score:5, Interesting)
Why isn't there any easy way to style a table column in CSS?
If you're serving legitimate, tabular data, and you want to right-align column #3 (normal for numerical data), you either have to apply a class to each cell, use javascript to apply it after the fact, or use hacks like:
Which work, but are difficult to maintain when you get 10+ columns, and don't try to automatically re-arrange columns with javascript.
Why can't we just place styles on a <col> or <colgroup>, and have it cascade down?
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.
Your feelings on SVG? (Score:3, Interesting)
How do you feel about SVG (as currently specified, not as a concept)? What problems do you think it has, and why do you think those problems came about? If some other group (like the WHAT WG) were to rewrite it, would you support that?
CSS Parent Selector? (Score:3, Interesting)
My question has to deal with selectors: why doesn't CSS have a parent selector? All too often I find myself wanting to refer to a parent or a sibling of the current element but cannot (I'm sure there are a bevy of workarounds for individual cases...)
ie Why can't I do something like this to refer to a table row (given a structure of <tr><td><a>) a:hover:parent:parent { background-color: #cff; }? It's a simple example, but there really isn't a way to do this without involving a client-side scripting language.
Thanks for your consideration.
Nesting (Score:3, Interesting)
Was nesting ever considered? For example, instead of:
something like:
Also, do you think CSS3 is too complex? Some of it seems nearly impossible to correctly implement across browsers. Is there any consideration going in to the speed and complexity of rendering? I fear that CSS3 (and beyond) are beginning to play into the assumption that all computers will be Pentium 4's with 2 GB of RAM and plenty of clock cycles to spare.
Re:Just one question (Score:5, Interesting)
Re:Just one question (Score:5, Interesting)
Re:Pronunciation (Score:5, Informative)
Re:pronounciation (Score:2)
If you have an issue with how he pronounces his name, you can take it up with him:
http://people.opera.com/howcome/ [opera.com]
or
howcome@opera.com
Re:Three column (Score:2)
Re:Three column (Score:2)