Slashdot Mirror


CSS Proposed 20 Years Ago Today

An anonymous reader writes: On 10 October 1994, Opera CTO Hakon Lie posted a proposal for Cascading HTML style sheets. Now, two decades on, CSS has become one of the modern web's most important building blocks. The Opera dev blog just posted an interview with Lie about how CSS came to be, and what he thinks of it now. He says that if these standards were not made, "the web would have become a giant fax machine where pictures of text would be passed along." He also talks about competing proposals around the same time period, and mentions his biggest mistake: not producing a test suite along with the CSS1 spec. He thinks this would have gotten the early browsers to support it more quickly and more accurately. Lie also thinks CSS has a strong future: "New ideas will come along, but they will extend CSS rather than replace it. I believe that the CSS code we write today will be readable by computers 500 years from now."

25 of 180 comments (clear)

  1. They _Should_ Replace It by Anonymous Coward · · Score: 5, Insightful

    I’m sure this won’t be the only "css" sucks comment. I didn't like css when it first came out, I didn't like it when it became supported enough to use, and I still don't like it.

    For styling and formatting it’s ok, but for layout it is a convoluted mess. Grid based layout is a standard of just about every UI engine for a reason we like stuff to line up, we like stuff to scale gracefully, and grid based systems work very well for both. "But.. but.. in html tables were made for text" I can hear some web dev whine. That doesn’t mean the whole concept of grid based layout should be tossed out and replaced by the clusterfuck that is CSS layout.

    Simple things like a complex form, which would be trivial with a grid (and are trivial with tables) are an epic pain with CSS layouts. And what great benefit has it given us? Panels that float around the screen (and break if something is resized, zoomed in, or a block of text is larger than expected).

    And detaching content from style epic failure. The oft referenced CSS Zen Garden is to me an illustration of exactly how CSS failed at this goal. The layout is still being largely defined by the HTML. You can only _somewhat_ adjust how things are positioned in relation to each other with CSS, which requires you to have multiple layers of nested <div id="random_section_that_you_might_use_for_something_or_not"> to give the kind of flexibility that CSS Zen Garden does. Actually take a look at the HTML for those pages. This is not an example of how things should be done.

    1. Re:They _Should_ Replace It by Anrego · · Score: 3, Informative

      You can only _somewhat_ adjust how things are positioned in relation to each other with CSS, which requires you to have multiple layers of nested <div id="random_section_that_you_might_use_for_something_or_not"> to give the kind of flexibility that CSS Zen Garden does.

      That's actually no longer totally the case. There is even a comment in the code:

      <!--

              These superfluous divs/spans were originally provided as catch-alls to add extra imagery.
              These days we have full ::before and ::after support, favour using those instead.
              These only remain for historical design compatibility. They might go away one day.

      -->

      That said, I totally agree with everything else you said. CSS is an example of fixing a barely existent problem by introducing a bunch of major ones. Tables worked fine, and could have been cleaned up or replaced/augmented by something made for layout.

      I'm not a web developer, so maybe you grow to like it, but I always found div based layout unintuitive as hell ("oh, I need to float left this div to make it centered and set the block to inline"). I still just use tables any time I dabble with that stuff. They still work!

    2. Re:They _Should_ Replace It by wiredlogic · · Score: 2

      That's because web pages aren't supposed to give fine grained control of layout. Switch to PDF or campaign for browser support of XSL-FO if you want to control layout.

      --
      I am becoming gerund, destroyer of verbs.
    3. Re:They _Should_ Replace It by FictionPimp · · Score: 4, Informative

      Using a fluid grid based css layout is faster, easier to write/understand/support, and a hell of a lot cleaner than tables. Having done web development for the last decade I have to say that tables for layout was a pain in the ass and a bad hack at best.

      With html5/css3 almost all of your concerns are gone. In fact you can download a nice fluid grid based template in a second that can cut your table based layout development time into a 5th.

      Check out http://www.getskeleton.com/ or even the often overused http://getbootstrap.com/

    4. Re:They _Should_ Replace It by itsdapead · · Score: 5, Insightful

      I’m sure this won’t be the only "css" sucks comment.

      You missed the absence of any sort of variables/constants to let you (e.g.) assign a logical name to a frequently used colour or a standard indent width. Preprocessors like "less" are a great help, of course, but I can't believe a simple macro substitution facility or simple expression evaluation would have over-taxed even 20 year-old hardware.

      Then there's the bizarre box model where the size of the contents, border, inner and outer margin are all conflated - even Microsoft's mis-implementation made more sense. Or the simple, but completely non-obvious incantations to make a div act as a container, or auto-clear floats. I still can't get my head around list formatting.

      Basically, you're left with the feeling that the designers of CSS had never used a DTP package, never used styles in a wordprocessor package, never used a UI layout manager or, for that matter, ever seen a website.

      TFS was also right on the money in one respect: a standard with neither a test suite or a reference implementation is no standard at all. The whole set of web standards suffers from the delusion that (maybe outside of pure mathematics) you can reliably specify a complex system without non-trivial exemplification.

      --
      In a survey of 100 programmers, 111111 thought that duck-typing was a good idea.
    5. Re:They _Should_ Replace It by BarbaraHudson · · Score: 4, Insightful

      I believe that the CSS code we write today will be readable by computers 500 years from now."

      If we're still using CSS 500 years from now, we're screwed. Heck, we better have something a whole lot better than web pages 500 years from now.

      500 years? Look at what's come and gone in the last 50, and get back to me.

      --
      "Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
    6. Re:They _Should_ Replace It by squiggleslash · · Score: 3, Insightful

      I can't comment on getskeleton, I've never heard of it and the one page summary is about as useful as a chocolate teapot, but I do use Bootstrap, and while it can produce nice results (yay responsiveness), I'm not remotely convinced it is somehow better than tables in terms of producing websites that separate content from presentation. You end up building tables anyway, except that instead of using tr/td you use divs with row/col-md-694 classes.

      It's actually as if Bootstrap's designers know that actually you want to use tables but know it's politically incorrect to use them...

      (Again, before you yell at me, yes, I like the fact there's some degree of responsiveness not possible with 1995 HTML tables, but you have to wonder whether if HTML had evolved with something other than CSS, we'd have a responsive websites system built around the tables designers have always found easier to use.)

      --
      You are not alone. This is not normal. None of this is normal.
    7. Re:They _Should_ Replace It by RabidReindeer · · Score: 2

      Grid based layout is a standard of just about every UI engine for a reason we like stuff to line up, we like stuff to scale gracefully, and grid based systems work very well for both. "But.. but.. in html tables were made for text" I can hear some web dev whine. That doesn’t mean the whole concept of grid based layout should be tossed out and replaced by the clusterfuck that is CSS layout.

      Simple things like a complex form, which would be trivial with a grid (and are trivial with tables) are an epic pain with CSS layouts. And what great benefit has it given us? Panels that float around the screen (and break if something is resized, zoomed in, or a block of text is larger than expected).

      And detaching content from style epic failure. The oft referenced CSS Zen Garden is to me an illustration of exactly how CSS failed at this goal. The layout is still being largely defined by the HTML. You can only _somewhat_ adjust how things are positioned in relation to each other with CSS, which requires you to have multiple layers of nested <div id="random_section_that_you_might_use_for_something_or_not"> to give the kind of flexibility that CSS Zen Garden does. Actually take a look at the HTML for those pages. This is not an example of how things should be done.

      Well, after all, it's Cascading style Sheets. There's nothing in CSS itself that actually bounds an area - it has to borrow a container from HTML, be it DIV, TABLE, BODY, or whatever and define space within or relative to it.

      I never bought into the "don't use tables" nonsense myself. Tables provide abstract organization of layout. It's a lot cleaner to apply some CSS to a table than to shoehorn it in to a whole lot of divs just for maintaine Ideotlogical Purity..

    8. Re:They _Should_ Replace It by Man+On+Pink+Corner · · Score: 3, Insightful

      If the standards do not respect the users, the users will not respect the standards.

    9. Re:They _Should_ Replace It by FictionPimp · · Score: 2

      Let's face it, grid based layouts are tables and if all websites were static html, then html tables would suit us just fine. If we didn't want to cater to people with disabilities or screne readers then again, tables were fine.

      It's a lot easier to replace, remove, or add a class on a article or div with javascript then to try to reflow a html table based layout (like when you go mobile and turn that 3 column layout into a single column. . It's a lot easier to parse the html to do something with it (like screen read) if you don't have a bunch of junk spacer images, tr's and tds, cluttering up the mix.

      I wouldn't be opposed to something better than css, but I still think css layout is better than html table layout.

    10. Re:They _Should_ Replace It by Anonymous Coward · · Score: 2, Informative

      Two reasons not to use tables for layout on the web:

      1. Tables are meant for tabular data. The table tag has a semantic meaning that is very different from layouting. This can cause trouble for blind people using screen readers to view web pages. The screen reader sees a table, thinks it is important information, similar in importance to a paragraph of text, and starts reading out it's contents. This works fine as long as the table tag is used for user digestible information as it was intended, but not when the entire page is one giant table full of menus, links, logos and other cruft. Any other software parsing webpages to extract meaning could run into the same issue.

      2. As a consequence of point 1, the design and implementation of the table tag meant that tables would not be displayed on the page before the contents of the entire table were downloaded. (a table with missing values doesn't make much sense) So if you were to make a webpage as one giant table, then the entire page would only be displayed once all the contents of that table, such as images and walls of text were entirely downloaded. This meant if you wanted your website to be as responsive as possible, you would better avoid tables for layouting. I don't know if this particular issue is still relevant today with modern browsers.

    11. Re:They _Should_ Replace It by JohnFen · · Score: 2

      The problem with tables is that they generally were very inflexible.

      True, but this problem can be worked around by using dynamically generated web pages -- which brings an additional benefit of still separating layout from content, if you feel that's important.

      Trying to resize your browser (back in the day) often caused strange layout issues (and lets not forget the 1px transparent GIFs).

      A problem that CSS has not actually resolved, judging by the number of websites that become unusable when I make my browser window my preferred size.

    12. Re:They _Should_ Replace It by Grishnakh · · Score: 2

      Firefox implemented CSS variables back in version 31. Your claim is false.

      Is that part of the CSS standard? No? Then it's irrelevant.

    13. Re:They _Should_ Replace It by Euler · · Score: 2

      Ahh, the classic arguments. I'll avoid my tirade about people who move the goalpost on every web-related standard rather than accepting success and moving on with new actual ideas. But I'll settle that you can have CSS layout and I'll use tables when I damn well feel like it. 20 years of evangelism hasn't really made the web a cleaner place. "Improving" web standards always missed the point that what we have is what we have; old pages will not get updated so we still support them. HTML 5, or whatever is fine, but browsers still have to support what is out there.

      1) "Tables are for tabular data" Yeah, 'ya know why? Because tables are precise and predictable. Will puppies and and kittens die if I use tables for layout? No. You cannot deprecate tables and their ability to hold other elements because I could always claim that a series of pictures, links, and text is my tabular set of data. Therefore, why have this argument? Sub-argument: "blind people will be screwed" No, and how does CSS solve that problem? Are the rest of us to continuously suffer layout glitches? CSS creates a series of sections that don't specifically have a semantic order or significance either. The very definition of Zen garden is the ability to re-arrange parts of a web page in any visual orientation. The fundamental problem is that people create pages with too much complexity whether it be nested tables or CSS placement. If we can't design software that could use a few heuristics to locate the main text of a page, then the page is too complicated to be useful, or your screen reader sucks.
      A few meta-tags, and reasonable discipline on nested tables would have been the simple approach to this supposed problem. Most web pages I see are still a basic 3-panel with header navbar and boilerplate footer. Anything else gets too complicated.

      2) "The page has to totally load first" Not really a problem since tables have a variety of ways to define width, justification, etc. Plus, why do I care what a page looks like while it is downloading? This isn't 1994 anymore, we have decent bandwidth. Most websites that actually have tabular data like forums, Facebook, etc. ironically use some form of dynamic content anyway which is far more abusive in terms of the page layout changing unexpectedly. We may as well just deprecate scroll-bars, because they behave erratically when a webpage loads more content halfway through scrolling down a page.

      CSS is a great way to take out the redundancy of style and font tags everywhere, but I think the idea of CSS layout is just confounding.

    14. Re:They _Should_ Replace It by BarbaraHudson · · Score: 2

      Plenty of early machines used the audio cassette interface to load and save programs. The IBM PC had to include a cassette interface because pretty much *everyone* included one. BASIC is BASIC. Porting from one machine to another wasn't a big deal, and taking a couple of minutes to load or save a program was a lot more acceptable than having to re-enter it every time. Also, those old floppy drives weren't all that much faster.

      --
      "Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
  2. 500 years! I hope not by us7892 · · Score: 2

    Maybe he meant to say 50 years?

  3. Wrong by sootman · · Score: 4, Insightful

    "the web would have become a giant fax machine where pictures of text would be passed along"

    No, we would have just kept using tables and <font> tags.

    --
    Dear Slashdot: next time you want to mess with the site, add a rich-text editor for comments.
    1. Re:Wrong by ZorglubZ · · Score: 2

      Or tags? Of which the only valid use is: Schroedinger's cat is not alive.

    2. Re:Wrong by Dr.+Evil · · Score: 2, Funny

      "The day I found out you can use a 1x1 transparent GIF to fill any space by using "width=xx, height=yy" in the tag, was the greatest day of my life."

      Things will get better.

  4. Re:500 years! I hope not by __aaclcg7560 · · Score: 3, Insightful

    C is still going strong after 40+ years, and may continue for another 50 years. CSS should stick around a little bit longer.

  5. And 20 years ago by OzPeter · · Score: 2

    Kurt Cobain saw what was being proposed and . . . . (well you know the rest)

    (Too soon?)

    --
    I am Slashdot. Are you Slashdot as well?
  6. Android by future+assassin · · Score: 2

    Well I thought since this was 2014 the browser css rendering inconsistencies were pretty much gone and for the most part they seem to be yet after testing a few websites I just build using some basic designs the default Android browser is rendering horizontal list/text spacing all wrong vs PC/iThings.

    So off I go to read up on it and all of a sudden there this @media query thing. After seeing some examples I'm liek WTF? People are using 100's of lines of extra markup or extra style sheets to make things cross platform. Talk about a flash back from the late 90's/early 2000's of nasty css.

    --
    by TheSpoom (715771) Uncaring Linux user here. I have nothing to add to this but please continue. *munches popcorn*
  7. Geometry-based layout by dskoll · · Score: 2

    The wonderful Tcl/Tk toolkit solved the layout problem in the 1990's with its excellent constraint-based geometry managers: The grid engine, the packer and the placer. I'm sure it would have been possible to express each of those layout engine's rules in something analogous to CSS.

    That would have made page layout so simple it'd almost be fun.

  8. Love CSS by WaffleMonster · · Score: 3, Interesting

    While I have a laundry list of complaints I like the underlying idea more than I dislike it. Amazing how simple html content ends up being and how flexible changes become once you have made a reasonable attempt to declare content and decouple style.

    This said I'm very much less certain what my sentiment of CSS actually translates to in the real world.

    The underlying problem while technology wants data presentation to work across maximal number of display sizes and capabilities such things too often appear as intolerable annoyances to designers. The world is teaming with fixed width websites and crap like zen garden is a joke. Without assumptions of fixed content tailored specifically for the garden those layouts would fall apart.

    It often takes different skill sets to design something that both looks cool and is able to survive with coolness intact across a number of different and perhaps unknowable parameter changes.

    This in my opinion is responsible for about half of the great tables v CSS layout arguments. What designers really want is for each page to have a known width and a known height without all of the compatibility bullshit or having to think about unknowns... what they actually want looks a heck of a lot more like PDF than it does HTML/CSS.

    Without significant design / technology change to bring competing interests into better alignment I wouldn't bet on CSS lasting 50 years.

  9. The tragedy of CSS by tigersha · · Score: 4, Interesting

    CSS is good. Really. It is not too bad, has a few warts and so, but we are finally there. Or will be in 5 years when all the browsers finally support the new Grid layout module.

    The problem with CSS is that it took 25 damn years to get to the point where windowing system were already in the 90s. There are 2 main problems up to now

    First, the block model. Seriously people, if I specify that a block has a width of 300 pixels I mean that the block has 300 pixels, and not the content inside the block without the padding. Really. That makes no sense. For some reason it did to the authors of the standard. It hurts me to say this, but Internet Explorer 5.5 got this right and simply ignored the stupid, dumb standard. Most of the nightare that is CSS layout was caused by this clusterfck of stupidity. Now there is finally a solution, one can set the box-sizing and almost all browsers support it. Those that do not are old and can fly.

    Secondly, tables vs grid. I get the whole tag is not semantic thing. Really. But often, strangely standards people, we DO WANT THINGS TO BLOODY LINE UP IN A TABLE. But nooooo, we must not use tables because it is not fashionable or something.

    Floats were meant to be used to put pictures inside a large block of text. It is great for that. Now it is used for laying out elements on a page. And this is supposed to be LESS hacky than using a table? Seriously??

    CSS grid layout finally, finally, finally solves all of this hacker bull. It does something that should have been in there since the 90s. After all, pretty much any window manage on the planet could deal with this back then. People still use tables because it is easier. Grid also decouples the sequence of the elements in the markup from the sequence on the screen, which is cool. But, but even Chrome only experimentally supports grid layout so I have to wait another 5 years.

    A couple of other things on my wishlist.

    Calculation. Based on the current state of the screen. Sometimes saying that I want the thing should be 500px - the width of the div with id #blabla would make a lot of all the CSS shenanigans unnecessary. Yes, I know that some designers can't add, but I can and I want to. And no, I do not want mathematica in there. Simple basic arithmetic would be fine. Right now you can do 3D transform in CSS3 but you can't subtract the width of an element??!! FFS why??!!! There is a new calc module but that will take another 5 yars to become commonplace.

    Better control of height. I want to say "This div fills the rest of the container vertically/horizontally" One of the reasons tables are useful for layout is that you CAN do this by setting the width of a column to *. Layout engines in GUI land, such as Interface builder and the oooold News uses a concept called Springs which expand. Coool feature, missing from CSS.

    The fact that you can book loads of courses and read lots of book on how to arrange things on a page with CSS is a real shame. It simply should not be necessary to have that level of expertise just to such a trivial thing.

    25 years. This is the time from the end of WW2 to the day I was born (almost precisely). 25 years is the time between the invention of the transistor and the invention of the CPU. 25 years is the time between the first flight and the first ocean crossing over the Atlantic. 25 years is the time that someone goes from being born to being a working productive adult. 26 years is the time between Columbus' discovery of the new world and Hernando Cortes conquest of the entire Aztec empire.

    25 years is a quarter of a century.

    25 years is the time between the invention of CSS and the moment it is viable to lay out a page without being an expert in some very arcane hackery. Why was this really necessary??!!!

    --
    The dangers of excessive individualism are nothing compared to the oppressiveness of excessive collectivism