Re: [WSG] When is invalid CSS okay?
I think one of the great things about the CSS specifications is that they specify how to handle errors, when rules should be ignored, etc. As long as your hacks follow these rules and a perfectly compliant browser would read it all correctly and ignore any fixes, that's fine. Conditional comments are better, though, as its quite obvious that a compliant browser should ignore them. (Don't get me wrong, I like conditional comments) Forget validation if a fully compliant parser would parse them properly. PS: Tantek has a great article on this at http://tantek.com/log/2005/11.html Daniel Brumbaugh Keeney Devi Web Development [EMAIL PROTECTED] On 8/22/07, Rick Lecoat [EMAIL PROTECTED] wrote: This is probably one of those questions that divides the audience (no, it doesn't involve brussel sprouts), but here goes: As exponents of web standards, we all know that one of the bedrock basics is that our code should validate -- both (x)html and css. But we also know that IE(win) is something of a recalcitrant beast and must occasionally be spanked into order with some hacks and/or conditionally commented stylesheets. And sometimes the workarounds required are non-valid CSS. So, is it considered 'okay', in a web standards sense, to have a non- valid bug-fixes stylesheet working alongside your perfect, pristine, uiber-valid main stylesheet? To give an example, if I were to have an IE-specific stylesheet with a lot of stuff like filter: alpha(opacity=50) in it -- which, a quick Google check informs me, does not validate -- would that be seen as a breach of web standards? Perhaps this whole issue is me getting too focused on the nitty gritty, but I'm in the process of moving from 'old-school' to web standards and am trying very hard to get it 'right'. This is just one of the goal posts that I'd like to clearly identify. Thanks. -- Rick Lecoat *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***
RE: [WSG] When is invalid CSS okay?
I think that a more appropriate example would be using: -moz-border-radius Any validator should tell you that this is non-standard, but it is up to you to decide whether or not to use it. Regards, Mike -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Nick Gleitzman Sent: Wednesday, August 22, 2007 7:23 PM To: wsg@webstandardsgroup.org Subject: Re: [WSG] When is invalid CSS okay? On 23 Aug 2007, at 3:07 AM, David Hucklesby wrote: After all, if I write about the Sheraton Centre in Manhattan, my U.S. spell checker tells me I misspelled Centre. So do I change the spelling? I think not. Hmm. Interesting example. 'Sheraton Center' is a placename - a proper noun. Have you ever tried to use 'text-align: centre'? N ___ omnivision. websight. http://www.omnivision.com.au/ *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] *** *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***
Re: [WSG] When is invalid CSS okay?
Gunlaug Sørtun wrote: The hiding effect gained by 'CC' is used by many to justify hacking and to declare their solutions valid - because the validator doesn't complain. It is ultimately laziness, but I don't want to have to expend the mental effort to distinguish between invalid CSS that is the result of a mistake and invalid CSS that is the result of hacking around IE. Or put another way, I don't want to get into the habit of being used to seeing my CSS not validate with the automatic test. This works for all browsers - with a bit of care. I assume here you mean 'all current major desktop browsers'? Rob *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***
Re: [WSG] When is invalid CSS okay?
Rob Crowther wrote: Gunlaug Sørtun wrote: The hiding effect gained by 'CC' is used by many to justify hacking and to declare their solutions valid - because the validator doesn't complain. It is ultimately laziness, but I don't want to have to expend the mental effort to distinguish between invalid CSS that is the result of a mistake and invalid CSS that is the result of hacking around IE. Or put another way, I don't want to get into the habit of being used to seeing my CSS not validate with the automatic test. Well, since valid doesn't mean applied according to standard, I have to proofread my CSS anyway. I can't rely on the validator more than on the spell-checker in the email client I use, so I do indeed distinguish between mistakes and intentional hacking - regardless of whether the latter are valid or not. It would be nice if the validator would flag nonsensical combinations of properties/values, so I could see at a glance where combinations like... Element { float: left; margin: 6px; display: inline; } ...have been used, since valid combinations like that only serve the purpose of killing an old browser bug. The usefulness of the validator reports would be so much greater then. This works for all browsers - with a bit of care. I assume here you mean 'all current major desktop browsers'? One has to draw the line somewhere, but I often check beyond the major desktop browsers if I apply one of the potentially more disturbing workarounds. How far I go depends on the case, the major user-group and the client. Whether or not a disturbance is acceptable, also depends on how standard compliant, implicit also how current, the disturbed browser is. That outweighs how major a browser in need of a workaround is - in most cases. regards Georg -- http://www.gunlaug.no *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***
Re: [WSG] When is invalid CSS okay?
Hey rick, This happened to me as I mentioned in the last issue, and When I spoke to my client and explained to him the reason he accepted it and chosen design and cross browser compatibility to complete valid CSS and the only thing that doesn't validate is the mozilla custom opacity: Parse Error - opacity=65) Property -moz-opacity doesn't exist : 0.65 however it all comes back to the client and their requests! On 8/22/07, Rick Lecoat [EMAIL PROTECTED] wrote: This is probably one of those questions that divides the audience (no, it doesn't involve brussel sprouts), but here goes: As exponents of web standards, we all know that one of the bedrock basics is that our code should validate -- both (x)html and css. But we also know that IE(win) is something of a recalcitrant beast and must occasionally be spanked into order with some hacks and/or conditionally commented stylesheets. And sometimes the workarounds required are non-valid CSS. So, is it considered 'okay', in a web standards sense, to have a non- valid bug-fixes stylesheet working alongside your perfect, pristine, uiber-valid main stylesheet? To give an example, if I were to have an IE-specific stylesheet with a lot of stuff like filter: alpha(opacity=50) in it -- which, a quick Google check informs me, does not validate -- would that be seen as a breach of web standards? Perhaps this whole issue is me getting too focused on the nitty gritty, but I'm in the process of moving from 'old-school' to web standards and am trying very hard to get it 'right'. This is just one of the goal posts that I'd like to clearly identify. Thanks. -- Rick Lecoat *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] *** -- http://www.Mjama.com *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***
RE: [WSG] When is invalid CSS okay?
Are you serving up your hacked stylesheet to everyone, or just to those crippled by IE? The latter is far more acceptable than the former, in my opinion. Mike -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Rick Lecoat Sent: Wednesday, August 22, 2007 11:27 AM To: Web Standards Group Subject: [WSG] When is invalid CSS okay? snip is it considered 'okay', in a web standards sense, to have a non- valid bug-fixes stylesheet working alongside your perfect, pristine, uiber-valid main stylesheet? *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***
Re: [WSG] When is invalid CSS okay?
Rick Lecoat wrote: So, is it considered 'okay', in a web standards sense, to have a non- valid bug-fixes stylesheet working alongside your perfect, pristine, uiber-valid main stylesheet? It is considered bad, but necessary and therefore acceptable by most web designers/developers. To give an example, if I were to have an IE-specific stylesheet with a lot of stuff like filter: alpha(opacity=50) in it -- which, a quick Google check informs me, does not validate -- would that be seen as a breach of web standards? It _is_ a breach of web standard, so some may see it as a sin :-) However, since there's no other real-world option in many cases, you may as well add the non-valid part to your pristine CSS and confess openly to having done so. An ordinary CSS comment may make most reasonable web designers/developers see the light, and make them defer from further comments on the issue. Perhaps this whole issue is me getting too focused on the nitty gritty, but I'm in the process of moving from 'old-school' to web standards and am trying very hard to get it 'right'. This is just one of the goal posts that I'd like to clearly identify. - If there are valid and logical options, then non-valid solutions should be avoided. - If no valid and logical options are available, then the _logical_ thing to do is to make it work if at all possible - choosing the most reliable workaround for weak standard-support and browser bugs, even if validity suffers a bit. Whether we separate the valid from the valid parts by using separate stylesheets, or simply leave the non-valid parts in the stream, depends mostly on the local workflow and personal preferences. 'Conditional comments' for IE versions provides us with a practical separation-solution, but the hiding-effect (that the validator can't see the separate and non-valid workaround) doesn't make the non-valid workaround more valid. Thus, my personal preference is *not* to use 'conditional comments' unless there's no other way to achieve separation and prevent other _browsers_ from being disturbed by the non-valid workarounds. I see no point in hiding my sins, although I daily hide lots of IE garbage as a result of the separation-process itself. regards Georg -- http://www.gunlaug.no *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***
Re: [WSG] When is invalid CSS okay?
If its only to get around bugs in IE then id also have to say its ok, its the not the developers fault bill gates still cannot get anything right (well not bill gates but his developers, seen as he has shown alot of interest in web standards, his browsers still suck). Anything apart from this id say no. If it cant be done, dont hack away and try to make something possible, you'll end up with a right mess. James Jeffery On 8/22/07, Rick Lecoat [EMAIL PROTECTED] wrote: This is probably one of those questions that divides the audience (no, it doesn't involve brussel sprouts), but here goes: As exponents of web standards, we all know that one of the bedrock basics is that our code should validate -- both (x)html and css. But we also know that IE(win) is something of a recalcitrant beast and must occasionally be spanked into order with some hacks and/or conditionally commented stylesheets. And sometimes the workarounds required are non-valid CSS. So, is it considered 'okay', in a web standards sense, to have a non- valid bug-fixes stylesheet working alongside your perfect, pristine, uiber-valid main stylesheet? To give an example, if I were to have an IE-specific stylesheet with a lot of stuff like filter: alpha(opacity=50) in it -- which, a quick Google check informs me, does not validate -- would that be seen as a breach of web standards? Perhaps this whole issue is me getting too focused on the nitty gritty, but I'm in the process of moving from 'old-school' to web standards and am trying very hard to get it 'right'. This is just one of the goal posts that I'd like to clearly identify. Thanks. -- Rick Lecoat *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] *** *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***
Re: [WSG] When is invalid CSS okay?
On 22/8/07 (12:12) [EMAIL PROTECTED] said: Are you serving up your hacked stylesheet to everyone, or just to those crippled by IE? The latter is far more acceptable than the former, in my opinion. Just the victims of IE. I'm of the opinion that hacks -- ie. workarounds exploiting browser bugs and loopholes in css implementation -- are an inferior solution compared to serving valid browser-specific css via conditional commenting, simply because the bugs and loopholes can get fixed or closed at any time, potentially breaking hack-based css. Cond.comments, on the other hand, are an official M$-approved technique and as such should be around for the foreseeable future. But sometimes the CSS that needs to go into the Conditionally Commented stylesheet isn't valid -- IE's filters being a prime example. -- Rick Lecoat *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***
Re: [WSG] When is invalid CSS okay?
On 22/8/07 (12:12) Georg said: It is considered bad, but necessary and therefore acceptable by most web designers/developers. That's what I thought, Georg, but it's good to hear it confirmed -- seeing as how we don't live in that 'ideal world' that I keep hearing so much about. 'Conditional comments' for IE versions provides us with a practical separation-solution, but the hiding-effect (that the validator can't see the separate and non-valid workaround) doesn't make the non-valid workaround more valid. Thus, my personal preference is *not* to use 'conditional comments' unless there's no other way to achieve separation and prevent other _browsers_ from being disturbed by the non-valid workarounds. I see no point in hiding my sins, although I daily hide lots of IE garbage as a result of the separation-process itself. I fully agree that separating the non-valid 'fixes' stylesheet from the main one does not make it any more valid. However, I'm curious about why your personal preference is for NOT using Conditional Comments; you seem to equate them with trying to hide embarrassing non-valid code, and I'm sure that some designers might use them for that. I'm certainly not trying to hide anything by using CCs (to be honest, I have a hard enough time convincing clients that valid code is even a benefit to them, so they aren't going to care if my IE stylesheet doesn't validate if, indeed, they even understand the concept). I use them primarily because they segue nicely into my deep-seated anal retention (everything subdivided and in its own file). Best... -- Rick Lecoat *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***
Re: [WSG] When is invalid CSS okay?
Rick, The key thing to consider is this: • Invalid *ML will force browsers into defective behaviour. If your markup isn't written according to the very clear spec, the browser has to make assumptions. Different browsers make different assumptions at different times – you are leaving yourself open to all sorts of trouble. Don't do it! • Invalid CSS is written because *perfectly valid CSS*, especially in ambitious designs, *will cause different browsers to behave in different ways*. In complete opposite to invalid markup, invalid CSS often has to be used to secure consistent behaviour accross circumstances. I regularly use MS proprietary CSS (off-spec and therefore invalid: zoom, filter, etc.), the comma hack (',' at the end of selectors, feeds the rules to IE* only, and is considered bad syntax), and various comment hacks (break rules up with comments to render them as simply bad syntax to all modern browsers) – to ensure a standardised experience for as many users as possible. Of course such effects must be understood before they are used – but in all likelihood you are only using them because you've seen that things screw up if you don't. The worst that can happen is an unforseen display problem, or you getting confused in hindsight as to how everything's holding together through non-spec CSS. Aside from that and the withering glare of unemployed standardista mullahs, you have nothing to worry about. Regards, Barney PS: I just read your post regarding the danger of hacks getting fixed. My answer to this is simple: Whenever a major browser comes out, I have to recheck all my designs and see what behaviour it exhibits – and deal with it. Whether I use hacks or not, I'm still going to check and quite possibly (remember when IE7 hit the streets?) have to fine-tune for it anyway. In this circumstance hacks are just more code to go through – although with a fair bit of luck we will work out which hacks apply and safely be able to ignore the rest. It's not as if any new Microsoft release leaves puritan non-hackers laughing. *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***
Re: [WSG] When is invalid CSS okay?
On 22/8/07 (12:57) Barney said: ? Invalid *ML will force browsers into defective behaviour. If your markup isn't written according to the very clear spec, the browser has to make assumptions. Different browsers make different assumptions at different times - you are leaving yourself open to all sorts of trouble. Don't do it! ? Invalid CSS is written because *perfectly valid CSS*, especially in ambitious designs, *will cause different browsers to behave in different ways*. In complete opposite to invalid markup, invalid CSS often has to be used to secure consistent behaviour accross circumstances. Absolutely. Just to be clear, then, I was talking specifically about invalid CSS, not (X)HTML. The markup MUST validate, as you say. Otherwise it doesn't go out the door. PS: I just read your post regarding the danger of hacks getting fixed. I re-read that post of mine and it might have sounded like I was wagging an admonishing finger at anyone who uses hacks rather than Cond.Comments. Nothing could be farther from the truth. If I can solve a problem equally well using either technique then I'd rather go the CC route rather than doing the style-hiding/applying in the stream of the main CSS file via hacks... but that's a personal preference. And it's a recent preference, too -- in the past I've sure used my share of hacks in an all-in-one CSS file. So no finger wagging here. One thing's for sure: I'm here to learn, not preach. Best regards; -- Rick Lecoat *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***
Re: [WSG] When is invalid CSS okay?
Rick Lecoat wrote: [..] However, I'm curious about why your personal preference is for NOT using Conditional Comments; you seem to equate them with trying to hide embarrassing non-valid code, and I'm sure that some designers might use them for that. The hiding effect gained by 'CC' is used by many to justify hacking and to declare their solutions valid - because the validator doesn't complain. To me, such valid claims are nonsensical, and cloud the issue that we _have to_ hack our way around IE weaknesses one way or another. To me, a working hack to make IE behave isn't embarrassing at all, although it may be embarrassing for the creators of that browser. The real reason for me to not use 'CC' for separation, is that the versioning goes on on HTML level and adds unnecessary garbage to every single page. I prefer to separate on CSS level so the amount of garbage is kept to a minimum, and so that I can limit creation and updating of workarounds to a few lines in a stylesheet. Most often I just add the necessary workarounds in the main stylesheets - and just test to make sure the workarounds don't disturb other browsers. This works for all browsers - with a bit of care. The fact that the validator flags non-valid workarounds is a real time-saver during upgrading, as I don't have to comment these workarounds in order to find them later on. At times I use IE's own CSS bugs to feed it a fake stylesheet while feeding non-IE browsers a real stylesheet. This is true separation. This method does indeed hide both valid and non-valid workarounds for IE from the validator - same as with a 'CC', but this hiding effect can't be avoided and I can live with it :-) The latter method is described here... http://www.gunlaug.no/contents/wd_additions_12.html ...and is used throughout that private site. I won't recommend this method, but it works just fine - with a bit of care. regards Georg -- http://www.gunlaug.no *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***
RE: [WSG] When is invalid CSS okay?
Gunlaug Sørtun wrote: The real reason for me to not use 'CC' for separation, is that the versioning goes on on HTML level and adds unnecessary garbage to every single page. If you happen to be designing an XHTML site and decide you want to use server-side scripting to deliver your pages as XHTML/xml-application to standards-compliant browsers and as HTML/text to MSIE, then you can selectively include your various Conditional Comments into only the HTML, dumbed-down-for-MSIE version. Then the unnecessary garbage CC's will not even show up in your pristine XHTML/CSS version. This is probably not that practical in most real-world cases, but it does take the separation idea to its logical conclusion. And for those who really want pristine, separated code, it is a viable solution. I like the CC method because it is easy to understand and it should be easy for a different developer to understand five years from now. CSS hacks, on the other hand, require a bit of arcane knowledge that may be difficult to understand for a newbie five years from now, even with explanatory comments added. But I agree with Gunlaug that the down-side of CC's is that it requires adding unnecessary garbage to every single X/HTML page's head section. Phil. *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***
Re: [WSG] When is invalid CSS okay?
On 22/8/07 (14:41) Georg said: The real reason for me to not use 'CC' for separation, is that the versioning goes on on HTML level and adds unnecessary garbage to every single page. That's a very good point. And, I was about to follow it up with I wish there was a way to use conditional comments inside CSS when I read further down your message and discovered that you'd answered it for me. Cheers. In fact, once I read it I suddenly remembered (doh!) that I used something very similar a few months ago, but had completely forgotten about it: @import url(allBrowsersStyle.css); /* The following (non-valid) import rule will be seen by IE (Win) 5-7*/ @import ieWin-fixes.css; The IEWin5-7 import hack was culled from this page: http://imfo.ru/csstest/css_hacks/import.php I must be tired. -- Rick Lecoat *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***
Re: [WSG] When is invalid CSS okay?
On Wed, 22 Aug 2007 11:27:11 +0100, Rick Lecoat wrote: [...] So, is it considered 'okay', in a web standards sense, to have a non- valid bug-fixes stylesheet working alongside your perfect, pristine, uiber-valid main stylesheet? Personally, after working with separate style sheets for IE, I found them difficult to maintain. I am now experimenting with a single style sheet for everything (including print styles). So far I like it. My view on validation is that it is as essential as a spell checker. Like a spell check, I think you need to use common sense with it. After all, if I write about the Sheraton Centre in Manhattan, my U.S. spell checker tells me I misspelled Centre. So do I change the spelling? I think not. Cordially, David -- *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***
Re: [WSG] When is invalid CSS okay?
On 23 Aug 2007, at 3:07 AM, David Hucklesby wrote: After all, if I write about the Sheraton Centre in Manhattan, my U.S. spell checker tells me I misspelled Centre. So do I change the spelling? I think not. Hmm. Interesting example. 'Sheraton Center' is a placename - a proper noun. Have you ever tried to use 'text-align: centre'? N ___ omnivision. websight. http://www.omnivision.com.au/ *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***
Re: [WSG] When is invalid CSS okay?
If it's name was Sheraton Center that's how it should be spelt. -- Stuart Foulstone. http://www.bigeasyweb.co.uk BigEasy Web Design 69 Flockton Court Rockingham Street Sheffield S1 4EB Tel. 07751 413451 On Wed, August 22, 2007 6:07 pm, David Hucklesby wrote: On Wed, 22 Aug 2007 11:27:11 +0100, Rick Lecoat wrote: [...] So, is it considered 'okay', in a web standards sense, to have a non- valid bug-fixes stylesheet working alongside your perfect, pristine, uiber-valid main stylesheet? Personally, after working with separate style sheets for IE, I found them difficult to maintain. I am now experimenting with a single style sheet for everything (including print styles). So far I like it. My view on validation is that it is as essential as a spell checker. Like a spell check, I think you need to use common sense with it. After all, if I write about the Sheraton Centre in Manhattan, my U.S. spell checker tells me I misspelled Centre. So do I change the spelling? I think not. Cordially, David -- *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] *** *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***