Slashdot Mirror


Ask Håkon About CSS or...?

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.

34 of 326 comments (clear)

  1. Re:Just one question by emo+boy · · Score: 5, Interesting

    Did you ever think CSS would take off like it has and what do you think is the biggest misuse of CSS today in your opinion?

  2. Love of free software by iceborer · · Score: 4, Funny

    Want to know why Håkon loves Free Software so much?

    Well...Håkon?

  3. Why? by Anonymous Coward · · Score: 5, Funny

    Free software is destroying american jobs. Why do you hate america?

  4. Opera by taskforce · · Score: 4, Interesting

    Opera 9.0 seems to offer a lot of decent additions to Opera's standards pool. How satisfied are you personally with the work the team has done on implementing standards, and is there anything in there you feel is superflous and anything you would have preferred to see which wasn't in there?

    --
    My 3D Texturing Skinning work (under construction)
  5. Padding by Anonymous Coward · · Score: 5, Interesting

    Why was the decision made to make padding apply outside of the width of a 'box', rather than inside, which would seem to make more sense?

    1. Re:Padding by Anonymous Coward · · Score: 5, Interesting

      In addition: Was an concideration given to the effect that this would have on blocks using percentages for sizes? Is any concideration being given to fixing the problems that this causes?

    2. Re:Padding by pikine · · Score: 5, Informative

      Space inside the box is the "padding," while space around (outside) the box is the "margin." Between "padding" and "margin," there is also a "border." I'm not sure if asking how the terminology is determined is very interesting.

      --
      I once had a signature.
  6. No, really! -- a slashdot editor wrote this! by Qubit · · Score: 5, Funny
    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.

    Duplicates? On Slashdot? Surely you jest, sir!

    --

    coding is life /* the rest is */
    1. Re:No, really! -- a slashdot editor wrote this! by colinbrash · · Score: 5, Funny

      Duplicates? On Slashdot? Surely you jest, sir!

  7. Why is CSS such a good idea but a pain to use? by 1155 · · Score: 5, Interesting

    CSS is a great idea, separating content from everything else. My problem with it is that it's such a horrendous beast of a thing to implement. For instance, there's nothing really good for say, putting something into "the middle" from what I can find. Now if there is, fine, don't make this question about the example. There are literally hundreds of design decisions that feel like they were implemented in a way to just make things as difficult as they can be.

    Why is CSS such a pain compared to other languages?

    1. Re:Why is CSS such a good idea but a pain to use? by mini+me · · Score: 4, Insightful
      Why is CSS such a pain compared to other languages?

      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.
    2. Re:Why is CSS such a good idea but a pain to use? by kaizokunami · · 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;
      }

    3. Re:Why is CSS such a good idea but a pain to use? by musicmaster · · Score: 4, Insightful

      Because CSS is based on many misunderstandings:

        - 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?

    4. Re:Why is CSS such a good idea but a pain to use? by rar · · Score: 5, Interesting

      ... There are literally hundreds of design decisions that feel like they were implemented in a way to just make things as difficult as they can be.

      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"?

  8. Re:Just one question by FooAtWFU · · Score: 5, Interesting

    On the topic of "misues of CSS", what's your take on the mess of CSS incompatibilities between Internet Explorer, Mozilla/Firefox, Opera, W3C standards, and the like? Do you have any choice words for any of the parties involved?

    --
    The World Wide Web is dying. Soon, we shall have only the Internet.
  9. Re: Two questions by Dolda2000 · · Score: 5, Interesting
    Oops, messed up the formatting -- trying again:

    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? ;)

  10. Included styles, aliases by Spy+der+Mann · · Score: 5, Interesting
    I always wanted to have "included" substyles or "aliases" in my CSS definition, to save redundancy.

    (For includes)
    .class1 { color:#ff0000; }
    .class2 { background-color:#ffffff; }
    .class3 { include:class1,class2;font-weight:bold; }
    (For aliases)
    @alias color1 #ff0000;
    @alias color2 #ffffff;
    @alias default_image url('/img/image1.jpg');
     
    .class1 { color:color1; }
    .class2 { background-image:default_image;background-color:co lor2; }
    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?
  11. CSS Evolution! by eieken · · Score: 5, Interesting

    Is the wave of webpages designed completely in CSS what you intially intended when you came up with CSS? Do you see that changing? Is that good or bad?

    --
    Meet new people, and kill them.
    1. Re:CSS Evolution! by truthsearch · · Score: 4, Funny

      CSS Evolution

      CSS is about intelligent design, not evolution!

  12. Re:Pronunciation by EvanED · · Score: 4, Informative

    To be fair, "how come" is how he describes it on his website, and he even uses the email address howcome@opera.com. That wasn't an editorial or something by the editors.

  13. Horizontally aligning multiple items by ars · · Score: 4, Interesting

    Why did you forget to include the ability horizontally align multiple items?

    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.

    --
    -Ariel
  14. About Microsoft... by Chabil+Ha' · · Score: 5, Interesting

    With MS's next browser release (IE 7), you mentioned in other interviews that their decision to not supprt CSS2 was more a political decision than a mechanical one. Aside from their obvious desire to dominate the world, what politics do you think are in play that make them not want to conform to the standard, and what do you think would change that landscape so that they would have some initiative to fully support it?

    --
    We're all hypocrites. We all have hidden parts, it's the contrast between them that make us more a hypocrite than others
  15. New standards by iamsure · · Score: 4, Interesting

    In your work at Opera, you have clearly paved a path that includes going beyond the W3C standards. Whether it is WhatWG implementations, or new functionality specific to Opera (2dgame), you are pushing into new territory.

    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?

  16. Vertical CSS Support by infestedsenses · · 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". Centering an object in the dead center of a page also requires strange procedures such as this one, 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?

  17. Misuse and Suggestions by lord_sarpedon · · Score: 5, Interesting

    Do you think that CSS is often misused? It seems to me that it is rarely used to define presentation in media other than the screen. As for my ideal stylesheet language... 1) Why must the layout be so linear? It seems to me that it would make more sense to have it operate closer to Autodesk Inventor, if you have ever used it, such that you set up whatever constraints (equal, parallel, etc) you see fit and the agent displaying the content finds a suitable solution. As an example, the login div must be equal width as the sidebar div, the sidebar div is at the left of the screen, the navbar is at the top of the screen and above the sidebar, and the content div is below the navbar and to the right of the sidebar. If everything is in a box, it would make sense to use other boxes as a reference point, rather than the screen. Pixels and percentages are nice and all, but not altogether natural. And pixels, while tempting, often don't cater to different resolutions. 2) Why would a spec for something that needs to be pixel-precise not come with an example implementation? 3) Shouldn't you be able to affect the document tree in a small way? If you are truly separating content and presentation, then why must I change the content to get the effect I want? I do this with XML + XSL + CSS, but just being able to add a div or image here and there would be nice...

    --
    "Strangers have the best candy" -Me
  18. Should CSS be a religion? by DysenteryInTheRanks · · Score: 4, Interesting

    I have mod privs but no one else is asking this question, at least not in a respectful manner, so here goes:

    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?

  19. Because of America harbors ursine evil. by Valdrax · · Score: 4, Funny

    Free software is destroying american jobs. Why do you hate america?

    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.

    --
    If it's for-profit but free, you're not the customer -- you're the product (e.g., the Slashdot Beta's "audience").
    1. Re:Because of America harbors ursine evil. by Millenniumman · · Score: 4, Funny

      No, it gives us the right to their arms.

      --
      Stupidity is like nuclear power, it can be used for good or evil. And you don't want to get any on you.
  20. {Gack.} by Rob+T+Firefly · · Score: 4, Interesting

    Why the curly brackets? Those things get on my damn nerves.

  21. Re: Two questions by Valdrax · · Score: 4, Funny

    Oops, messed up the formatting -- trying again...

    IRONY.

    --
    If it's for-profit but free, you're not the customer -- you're the product (e.g., the Slashdot Beta's "audience").
  22. Re:Idea? by Secrity · · Score: 4, Funny

    Shouldn't that be: "What possessed you to develop the idea of Cascading Style Sheets?"

  23. Definition of pixel by Sara+Chan · · Score: 5, Interesting

    The word pixel meant "picture element", but CSS redefined it to mean something quite different (a particular subtended angle of view). 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".

  24. Re:Where... by bcat24 · · Score: 5, Interesting

    CSS 3 *is* far into the future. :) It won't be a rec. for a long time, and it won't be supported by browsers (IE, I'm looking at you) for an eon.

    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.

  25. CSS for table columns? by oneiros27 · · Score: 4, 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:

    #tableid td+td+td { text-align: right } /* right align col 3 */
    #tableid td+td+td+td { text-align: inherit } /* stop right align at col 4 */

    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?

    --
    Build it, and they will come^Hplain.