CSS 2.1 Becomes W3C Recommendation 97
yuhong writes "After about a decade of development, CSS 2.1 has become a W3C recommendation. From the announcement: 'The current interoperability makes it easier than ever for developers and designers to enrich the toolkit. W3C expects future additions to CSS to be organized as independent modules, allowing smaller, more focused feature sets to progress and stabilize at their own pace. Some of these new features are already supported in browsers and other software in draft form (using the built-in CSS prefix mechanism designed for experimentation). As interoperability improves for each one, developers can transition to the standard to simplify their code. The CSS Working Group also publishes snapshots of which CSS features are supported interoperably in browsers; see, for instance, the most recent CSS Snapshot.'"
CSS *2.1*? (Score:2)
And while they are so slow finalizing the CSS standard, I use SASS [sass-lang.com] and CSS 3.0. SASS is not about adding new features, just some basic common sense in the grammar, allowing for nesting, variable substitution, and another couple of sugary things.
Next step they'll finalize a standard on BASIC from the 80s. :-p
Re: (Score:2)
Your point?
It's in Ruby (Score:2)
Re: (Score:2)
What a shame.
Re: (Score:2)
And there is nothing bad about it; I also like CoffeeScript [github.com] over Javascript, when possible. Not to mention the Vala language, that "compiles" in C.
If browsers do not support the syntax you like directly, there is nothing bad to ease your developer's work server-side, go with a DSL, and make it work in a browser as a standard-compliant code.
You sure do not expect that these changes first get voted on by the W3C, before they make road into browsers! That is my whole point, NOT to wait for them, but use a in
Re: (Score:2)
Yes, but why don't browsers offer us a simple binary platform? The open-source community could then develop compilers for any domain-specific language we want. We could then even implement our own version of HTML and CSS.
I think W3C has done a good job, but they are unintentionally keeping us, (open-source) developers, hostage.
Re: (Score:2)
Why? You can compile to HTML, JS or CSS just as you would compile to a binary format. I mean, many tools export to HTML already and projects like Pyjamas show that you're not forced to use Javascript.
Re: (Score:2)
Re: (Score:2)
Javascript is too high-level to serve as a convenient - and, more, importantly, efficient - backend for many statically-typed languages. It's also quite a waste to have all that type information at compile time, then ditch it all in translation to JS, and then have the runtime do very complex flow analysis trying to figure out the types to JIT-compile to efficient code.
In some cases, it simply doesn't offer the required facilities - e.g. there's no way to guarantee tail call optimization.
Re: (Score:2)
Chrome does, though it's still experimental. [google.com]
However, unless you're going to have your own version of HTML and CSS compile to real HTML and CSS, you lose a lot of the benefits of a web app in the first place. As it is, I don't see the problem with using tools like Haml and Sass. I've generally preferred actual JavaScript to preprocessors, but CoffeeScript looks awesome, I don't think I ever took a good look at it before.
The biggest annoyances of the current Web are all things we can deal with.
JavaScript is a
Re: (Score:2)
NaCl major flaw is its platform dependence. Sure, it covers the most popular platforms today, but it's not future-proof.
Now they also have PNaCl, where the browser downloads LLVM intermediate language (binary-serialized), compiles that to native, and then runs it in a NaCl sandbox. That is precisely the kind of thing needed - a low-level but nonetheless portable target platform that permits efficient implementation of various things. The only problem is that I'm not aware of any actual implementation so far
Re: (Score:2)
NaCl major flaw is its platform dependence. Sure, it covers the most popular platforms today, but it's not future-proof.
I suppose it technically is in the sense that there's always emulation...
Now they also have PNaCl, where the browser downloads LLVM intermediate language (binary-serialized), compiles that to native, and then runs it in a NaCl sandbox. That is precisely the kind of thing needed - a low-level but nonetheless portable target platform that permits efficient implementation of various things.
What I would wonder here is how efficient it is. How much are you giving up by not using pure native code? It looks like PNaCl is included with NaCl, otherwise it's pointless -- if I have to include an LLVM interpreter anyway, and I'm using low-level languages like C anyway, I may as well compile to native.
But if it is included, having this as an option makes sense in another way: Multiple fallbacks. If NaCl is available, but I don't h
Re: (Score:2)
What I would wonder here is how efficient it is. How much are you giving up by not using pure native code?
Nothing. LLVM is not an interpreter - it's a compiler. LLVM intermediate code is compiled to pure native code on browser side, and then the appropriate, architecture-dependent NaCl sandbox is used to run that. The benefit here is that when a new architecture becomes popular (consider how meteoric the recent ARM rise has been), the burden is on Google to provide a new NaCl sandbox, and on Apple (and Google) to provide an LLVM backend - your compiled binary remains the same and keeps working.
Re: (Score:1)
You suggest the W3C standardise on "Basic from the '80s" and don't see the irony in your using a smalltalk inspired language to generate CSS?
Sure, I've played with Vala and C compilers in-turn generate assembly. Do javascript or css need the language advancements made from asm to C to Vala (yes I ommited C++)? I do sometimes generate CSS on the serv
Re: (Score:2)
You suggest the W3C standardise on "Basic from the '80s" and don't see the irony in your using a smalltalk inspired language to generate CSS?
Web standards have moved on since then. So has Ruby.
Web standards are inspired by stuff like SGML, which is older than dirt. That's entirely beside the point. The point is that the W3C is standardizing stuff that we've been using for years, almost a decade. This is more like if C only became an official standard today.
Re: (Score:2)
Every aspect of your post is flamebait...
They managed to fuck up the syntax. They managed to fuck up the semantics.
In a few important ways, sure -- things which are fixable, and things which pale in comparison to other mainstream languages. I'd much prefer JavaScript to C++.
They managed to fuck up prototype-based OO.
In what way? It seems to work well in modern browsers.
They managed to fuck up the equality and inequality operators.
No worse than Perl, and from what I can tell, CoffeeScript deals with that problem.
The fact that you need to hide it as much as possible, whether using something like jQuery or CoffeeScript...
Sorry, what?
jQuery isn't even in the same category. It doesn't change the syntax. It doesn't "hide" anything. It provides a useful library abstracting over the DOM, which is
Re: (Score:2)
Re: (Score:2)
Yes, I've been hoping for way too long that someone at the W3C would just suggest something "radical" like simply adding simple reference variables in a useful way.
Even a very limited syntax like the below example would be useful:
$bluebg = { background:#00f; } div#foo { $bluebg; }
Now, something like this could easily be implemented as a server-side module, but I would rather see it implemented into CSS proper. And I know there are various tricks and workarounds, it would just be a neat and pow
Re: (Score:3)
Well, without doing any calculations I suspect that the cost to the user in terms of CPU cycles in negligible compared to some of the Javascript and massive (X)HTML documents sent these days.
Not to mention that it should with some optimization be possible to cut down on the parsing required (since the browser only has to parse the '$bluebg' block once as opposed to parsing say, 300 different 'background:#00f;' statements).
And the maintenance wins are potentially enormous (with a custom server-side setup you
Re: (Score:2)
you do realize that html elements can take multiple classes right? Variables are pointless
Re: (Score:2)
Of course I know that but it does not mean that variables in CSS would be pointless.
If anything variables would mean that you wouldn't be forced to say, use the same color value in multiple locations (or have a bunch of classes named "lightOrangeBackground", "darkOrangeBackground", "grayText", "lightGrayText" which makes for some annoyingly long lines in the HTML in the form of <div class="defaultLightBackground defaultDarkBackground blueLinks fooBorders barMargins">).
With variables/constants in the C
Re: (Score:2)
No. God forbids designers from programming...
(That's sarcasm btw)
Re: (Score:3)
There is: http://code.google.com/p/ecss/ [google.com]
The thing I dislike about these CSS extensions is that they all have different syntax and require a specific language/method
It would be great if one of these would run as an apache module, php/perl/python/ruby script, javascript, java/C# library, etc.
W3C does a great job, but they seem to go for semantical perfection instead of practical use.
Pet peeve: http://www.w3.org/TR/css3-color/#css2-system [w3.org] was deprecated in favour of http://www.w3.org/TR/css3-ui/#appearance [w3.org]. No
Re: (Score:2)
p.s. I know most browsers support CSS2 system colors, and most likely won't stop supporting it any time soon, but the fact that W3C has deprecated it in CSS3 tells me where their priorities are.
Re:CSS *2.1*? (Score:4, Insightful)
And while they are so slow finalizing the CSS standard
That's not a bug, it's a feature. The W3C, despite what some people think, is not a kind of "web government" that sits above browser makers, website designers etc. and tells them what to do. Rather, its purpose is to make the standards that the community has agreed on official.
This does mean that the W3C will have working groups staffed with industry officials and experts to work on those standards, yes; but it also means that a standard will only be finalized when it is, well, a standard: before that, the specification is there for everyone to adhere to, but it's still a draft - a proposal.
It helps when you think of draft standards as RFCs. In fact, that comparison is particularly apt insofar as that the IETF also published STDs, which are the ACTUAL standards (e.g. STD 5, also known as RFC0791, which describes IPv4).
Think about it.
Re: (Score:2)
The W3C, despite what some people think, is not a kind of "web government" that sits above browser makers, website designers etc. and tells them what to do. Rather, its purpose is to make the standards that the community has agreed on official.
Interesting. So basically they come a long and say, "hey you're all using that? Ok, it's a standard now". Well, thanks captain obvious. So really they are nothing more than glorified technical writers.
Re: (Score:2)
Think of them more as arbitrators whose job is to get the community to agree on something even when different parts of it want different things to happen.
Re: (Score:2)
Yea, W3C tried this with CSS 2.0 in 1998, and the fact that no browsers fully implements it is exactly why CSS 2.1 was created in the first place.
Re: (Score:2)
The W3C, despite what some people think, is not a kind of "web government" that sits above browser makers, website designers etc. and tells them what to do.
Since when? Remember XHTML [w3.org]? Or XForms [w3.org]? They were so far ahead of the curve that they took years to notice the rest of the community had turned off somewhere way back. Of course, that's back when Microsoft believed that packaging IE with Windows meant they didn't need to fix bugs or add features to it anymore.
Sure, some of their more out there stuff s
Re: (Score:2)
I don't get it and the SASS page doesn't explain, if it contains stuff that's not in CSS (which it implies) how will users view the content (receive the styles, whatever)?
Re: (Score:2)
Sass only contains things that aren't in CSS in terms of syntax and semantics. What's seen by the browser is valid CSS, but with Sass you get variables, functions, etc. for free. It makes it much easier to keep your templates and your presentation code DRY, and allows you to do things like compute colors or column-widths on the fly. But ultimately, you're producing CSS.
Re: (Score:2)
So it's precompiled, then? Or, there's a Javascript component? Or...?
Re: (Score:2)
It includes a precompiler and a module which somehow hooks into Ruby websites and compiles on-the-fly.
Now THAT makes sense. Oddly I didn't see the "only for Ruby" note anywhere. Another case where the software engineer needs to form a relationship with a web designer. Or maybe, a smarter one. Or maybe, a less smart one. Hard to say.
Re: (Score:2)
It's not only for Ruby. For on-the-fly compilation, there's a Rails plugin, but compilation can also be invoked manually from the command line. It is written in Ruby, but there's no reason you can't use Sass to generate CSS for PHP, Python, plain-old-HTML, etc. driven sites.
Re: (Score:2)
Re: (Score:2)
Have you ever tried writing a standard?
It took so long to finalize CSS 2.1 for two reasons:
1) There's a lot of complicated behavior the standard had to describe.
2) One of the criteria for a W3C REC nowadays is that there are two independent correct implementations of every part of the standard.
BASIC from the 80s is dead-simple in comparison, and probably still fails the criterion above. ;)
Re: (Score:2)
Next step they'll finalize a standard on BASIC from the 80s.
ISO/IEC 6373:1984 "Data Processing — Programming Languages — Minimal BASIC" was published in 1984.
ISO/IEC 10279:1991 "Information Technology - Programming Languages - Full BASIC" was published in 1991.
(the corresponding ANSI standards were published 4-5 years earlier).
CSS *2.1.*! (Score:2)
This is a quote from wikipedia, which might explain why CSS 2.1. is only *now* part of the recommendation:
The CSS Working Group began tackling issues that had not been addressed with CSS level 1, resulting in the creation of CSS level 2 on November 4, 1997. It was published as a W3C Recommendation on May 12, 1998. CSS level 3, which was started in 1998, is still under development as of 2009. In 2005 the CSS Working Groups decided to enforce the requirements for standards more strictly. This meant that already published standards like CSS 2.1, CSS 3 Selectors and CSS 3 Text were pulled back from Candidate Recommendation to Working Draft level.
Even so, what has the W3C been doing the last 6 years!?
Re: (Score:3)
Waiting for the browsers to implement the full specification...
One of the new requirements made to ensure the specifications are actually sane and useful is that it has to have two full independent implementations. But for that you first need a test-suite and you need browser-developers to make complete and correct implementations, unlike the usual practice of just implement some parts and call it supported (*cough* html5 *cough*)
Re: (Score:2)
So you don't actually define a standard until it's already implemented. Wish I could get away with writing my specs like that.
Re: (Score:2)
You define the standard before it's implemented, but you don't finalise it. A standard with no implementations is a draft or a proposal. You can't tell if it's sane until you try to implement it. It may accidentally (or maliciously) impose some constraints that are difficult to implement in some situations.
You also seem to be confusing a standard with a specification. A specification tells you how to build something. A standard tells you how to interface with something. Defining a specification aft
Re: (Score:2)
You define the standard before it's implemented, but you don't finalise it. A standard with no implementations is a draft or a proposal. You can't tell if it's sane until you try to implement it.
Yep, that is what W3C's Candidate Recommendation phase is for.
Re: (Score:1)
Re: (Score:2)
The big difference with CSS3 is that instead of one huge all-encompassing standard it's broken up into modules. Each module goes through the process independently of the others.
Two modules (colors and selectors) are currently Proposed Recommendations, with eight more being Candidate Recommendations.
http://www.css3.info/modules/ [css3.info]
Re: (Score:2)
And BTW most of them depends on CSS 2.1 to be at least Proposed Recommendation in order for them to become Recommendation (look in the Normative References section). For example, CSS3 Color was also made Recommendation today.
Re: (Score:2)
Nothing is ever bug-free. I do not know the specifics, but I guess they don't have to be bug-free as long as everyone agrees those are bugs.
Re: (Score:2)
unlike the usual practice of just implement some parts and call it supported (*cough* html5 *cough*)
And over time the browsers implement more parts. There is a reason why the WHATWG decided to call HTML a living standard.
Glad to see it finally achieve recommendation stat (Score:1)
Kewl,
But it's not like it wasn't a defacto standard anyway, for quite some time.
Let's see what mACROsFOT tries to embrace and extend on this one eh?
Re: (Score:3)
There is a difference between which standards has 'Recommendation' level, and which ones are recommended to use. CSS 2.1 has been recommended for a long time, it is just not a 'Recommendation'. Just like RFC standards doesn't actually want your comments.
For which CSS specifications that are recommended. Check out CSS Snapshot 2007 [w3.org], and don't worry about the 2007 name, the latest version is from May 2011.
Re: (Score:2)
Forget the CSS Snapshot 2007 link, the article summary has a link to CSS Snapshot 2010. Same thing with the year though, also last updated May 2011.
Re: (Score:2)
I've seen some people (foaming-at-the-mouth microsoft nutcases) claiming that nothing needs to be done right in the browser *until* the W3C finalises it. Watch MS try to spin this as a publicity stunt, despite their working group plants usually being the ones holding the process up.
Re: (Score:1)
Yep. Microsoft has a very cranky enterprise oriented customer base. They do not want to upgrade IE only to find out a bug screwed up an intranet app because the w3c changed a detail about a css property that the new IE follows. It seems there approach is to simply ignore the standards unless recommended as to prevent adoption. This causes everyone to wait as IE is the most popular browser in the world
Re: (Score:3)
Nobody is required to use these new technologies. HTML 3.2 and tables will still work as well as it ever did, so anyone can still do it All that's changed is that there are more advanced capabilities (out of necessity/efficiency requiring more stringent adherence) for those who want or need more. This is inevitable and essential to allow the Internet to grow beyond a collection of multi-coloured fonts on garish backgrounds with a couple of animated GIFs for decoration.
Even then, for those who want the capab
We need to move forward (Score:4, Interesting)
Ok, I know I'm gonna be modded as "Troll", but I need to say it: CSS is an horrible, backward, overly-complex standard. And yet, for philosophical / ideological reasons, it has been branded by the semantic folks as one of the most exciting innovation of the 20st century.
CSS has been invented in the days when most web pages consisted of simple blocks of text, with an occasional image floating left or right of it. All that was needed back then was changing the color of text, adding margins / paddings and that's about it. It was NOT designed to handle complex layouts: for that, you used tables.
And then the semantic folks arrived and told everyone using tables was baaaadddd for their main purpose was to present tabular data, not to layout things. And they were right, of course. But they made the wrong choice, deciding to extend CSS rather than crafting a new standard, specifically designed for the task. And here is the result: more than fifteen (15) years later, we still can't do simple things like "aligning this block to the bottom of this one" without using dirty - not semantic at all - hacks, or even falling back to JavaScript.
Even CSS 2 isn't supported properly by some browsers. Let alone CSS 3. And while you may think it isn't W3C's fault, I think perhaps, if some of the richest companies in the world haven't been able to implement this standard properly in, say, 10 years of continued effort, and that standard doesn't even reproduce all of the basic features that have been used in print for decades, it *might* be overly complex to get right. Look at these stupid cascading rules, for example: who seriously wants that ?
We need to move forward and develop new standards, focusing on /features/ rather than on pseudo-philosophical crap. We want to design websites that look great. Period.
Re: (Score:2)
foo { display: table-cell; }
It's been around since 1998, the only thing stopping people from using it was Internet Explorer 7 and below.
Re: (Score:2)
Huh... right. So, since I don't know HTML/CSS, please enlighten me ?
- How do I achieve the the sticky footer [ryanfait.com] effect without an ugly hack and without using additional markup ?
- How do I place a box to the bottom of another variable height box ?
- How do I vertically center a fixed-height box within another fixed-height box ?
If you come up with an easy, no-hack solution that truly achieves separation of style and semantics - that is, that doesn't force you to change your markup to layout things the way you wan
Two out of three solutions (Score:2)
sticky footer
I'm not familiar with this term "sticky footer", and the page you linked doesn't appear to give a precise definition
How do I place a box to the bottom of another variable height box ?
Outer box is position: relative. Inner box is position: absolute; bottom: 0.
How do I vertically center a fixed-height box within another fixed-height box ?
Google css vertical center gives this page [jakpsatweb.cz].
no-hack
I'd like to know what you mean by a "hack". Otherwise, I run the risk of every solution I suggest being called a "hack".
Re: (Score:2)
sticky footer
I'm not familiar with this term "sticky footer", and the page you linked doesn't appear to give a precise definition
OK. A sticky footer is a footer (...) that remains at the bottom of a page when there isn't enough content to fill the whole space, but that get pushed below when there is. In short, it's a footer that doesn't move to the middle of the page when it's almost empty.
How do I place a box to the bottom of another variable height box ?
Outer box is position: relative. Inner box is position: absolute; bottom: 0.
This "solution" pulls the positioned box out of the flow, so content may be hidden. Oh yes, of course, we might add some padding to fix this, but what happens when we don't know the height of the box ? Tricky, isn't it ?
How do I vertically center a fixed-height box within another fixed-height box ?
Google css vertical center gives this page [jakpsatweb.cz].
Your example doesn't work in
Re: (Score:2)
A sticky footer is a footer (...) that remains at the bottom of a page when there isn't enough content to fill the whole space, but that get pushed below when there is.
Oh, you mean giving an element min-height: 100% of the viewport height, as this page describes [xs4all.nl].
Your example doesn't work in Chrome. Rejected.
I don't have Chrome installed on this computer. In which web browsers must examples work?
example: adding additional markup violates the "semantics / content separation" principle
Even if an XSLT (EXtensible Stylesheet Language Transformation) style sheet adds this markup?
Re: (Score:1)
Adding any padding to the container totally breaks the layout in Firefox 3.X / Chrome / Safari.
Then put html,body { padding: 0 } and put padding on the inner elements instead.
Yes, that's a solution, but XHTML becoming a second-class citizen with HTML 5, it won't remain applicable in many work environments.
I was under the impression that the XML serialization of HTML5 was still coequal with the custom kinda-sorta-SGML serialization. When did this change?
Re: (Score:2)
Tables weren't designed to handle complex layouts either.
The concept of separating semantics and presentation was
Re: (Score:2)
Tables weren't designed to handle complex layouts either.
Never said that it was, nor that table are a great tool for that. My point is: CSS wasn't born as a layout tool, but as a /styling/ tool. Hence the name.
The concept of separating semantics and presentation was around well before CSS. CSS was designed for this. They weren't "extending" CSS, that's what it's for.
My point (which you seem to miss entirely) was that CSS hasn't been designed as a layout tool. It was, of course, designed to separate semantics and presentation. But back then, presentation mostly meant: "which color should I use for this title ?" or "would this yellow text look better on a black or on a blue background ?". CSS was a great tool for such de
Re: (Score:2)
AFAIK the reason CSS 2.1 was created in the first place was that no browser actually fully implemented CSS 2.0 to the letter due to the many problems with the spec. And remember CSS 2.1 did not exist when IE6 was released.
Re: (Score:2)
Tables weren't designed to handle complex layouts either.
But they do a far better job of it than CSS - even properly implemented CSS.
The concept of separating semantics and presentation was around well before CSS. CSS was designed for this.
Except it does a bloody lousy job because, to achieve particular effects with CSS (e.g. the sort of multi-column layout that is ubiquitous on websites) your "semantic" mark-up has to be written with precisely the right hierarchy of properly-named "div" elements in the correct order.
Unfortunately, CSS gives the impression of being "designed" by a committee who had never visited a late-1990s-era webpage, used a DTP package, or used
Re: (Score:2)
The reason that CSS is so complex and such a pain to implement is the combinatorial explosion when you have multiple interacting features. The standard has to define how they interact, and UAs have to implement the interactions. Any standard that focuses on features but not their interactions with each other will simply mean that browsers handle interaction of the features differently.... and any standard that actually tries to standardize behavior will be just as complicated as CSS by the time it reaches
Re: (Score:2)
Even CSS 2 isn't supported properly by some browsers.
And when is page-break-inside finally going to be supported? Man, that would be helpful.
What good is a standard if no browser fully supports it and when some browsers (*cough* IE *cough*) flat-out ignore them.
The problem with CSS goes back to its creator (Score:2)
Adding any form of macros or additional scopes and indirections, including symbolic constants, is not just redundant, but changes CSS in ways that make it unsuitable for its intended audience. Given that there is currently no alternative to CSS, these things must not be added.
- Bert Bos, W3C/ERCIM
That's not only idiotic, it's also kind of douchey. Macros and variables make it unsuitable for web designers? PLEASE. Learning to use Dreamweaver efficiently is harder than learning Sass to do styles with all the nice features CSS lacks by design.
Just remember that CSS is HORRIBLE BY DESIGN, and you'll be OK.
CSS 2 finally a Recommendation, in other news... (Score:2)
Duke Nukem Forever hits stores on June 14, 2011. 2K Games, now the patron saint of lost causes, has agreed to spearhead the shepherding of CSS 3 through the W3C standards process. They have committed to the publishing of CSS 3 as a formal standard by the time Duke Nukem Infinity hits store shelves in 2020.
The great thing... (Score:2)
...about [web] standards is that there are so many crappy ones [cat-v.org] to choose from.
That said, I thank all deities ever dreamed up that CSS is not an an XML dialect [cat-v.org], the semantics are a mess, but at least its got a minimally sane syntax, which is quite a rarity this days (JSON is another rare exception).