9 Ways to misunderstand Web Standards

xiaoxiao2021-04-09  439

URL: http://blog.outer-court.com/archive/2006-06-23-n15.html

Mesunderstanding # 1: "We need Separate Print Pages"

We've all seen this - a separate print page, linked to from a crowded, table-layoutish HTML page, aiming to serve no other need than being printed out (it fails, because bloggers link to print pages - they're mostly easier to read and not split up into multiple pages). The good thing about these pages is that the user gets an instant impression of what the print-out will look like. of course, the right way to do this would be to serve a separate Stylesheet for Medium Print, Andiff The Browser Does It Right, IT Will Show The Visitor A Print Preview.

This is old news, but why do I consider it noteworthy? Because it's the # 1 application where media-dependent CSS, on top of media-independent HTML, ought to come into play ... and yet, and I'm guessing, ONLY 5% of all pages make use of it. You'D thinking at years of evangelizing done by Web Developers, The Likes of CNN or Wired Would Would Gotten The Point.

Misunderstanding # 2: "We need an alternative mobile web on top of the existing design web"

WML, the WAP's Wireless Markup Language, is dead today for a good reason:. There was no need for this species in the course of web evolution Even before WML was invented, plain vanilla HTML was created to be media-independent Not by accident. .

But the fact that the same document can be used in a variety of circumstances, and that the browser simply requests the stylesheet needed - or uses its own, by default - is not an intuitive one to grasp Most real world objects do not behave. that way, changing their shape and behavior depending on what is needed (A German joke goes like this:. "What is the smartest invention of the 20th century The thermos flask, as it knows it needs to keep things warm in Winter, and? cold in Summer. ") So today, you'll see many companies creating an alternative mobile web. Well, those who can afford it, anyway, like Google (which is releasing products like Search or Gmail in special mobile versions, while often ignoring Accessibility Guidelines on Their "Main" Sites).

Now, you might argue, it's not so much a technical matter of how to serve the mobile web -. It's a matter of finding the right content fitting small devices However, we simply do not know in which contexts a visitor might want to read A LONGER TEXT. AT My Last Job I Used to Drive In The Train and Bus for About An Hour Every Morning, And During Time, I Used My Cell Phone's Browser To Read Longer Articles. When I Was At Work ON A Bigger Screen, I Had Much Less Time To Read Articles. (People Watch Movies on Their PSP ... It's really not all about screen-size.)

What was the original solution to formatting the same document for both the desktop screen, and the mobile device? Media-dependent stylesheets, again, delivered on top of the same HTML. And yet, if you look at different mobile browsers available today, you 'll see That the might do any of the following:

ignore all your stylesheets, and do something more or less reasonable with the HTML (eg breaking up table layouts) use the screen stylesheet, but adjust it here and there to fit the smaller resolutionuse the handheld stylesheet, but only if you deliver your XHTML using the "XHTML Mobile 1.0" doctype (what is the need for yet another doctype, when plain XHTML claims to serve mobile media already?) use the mobile stylesheet, if available, and use its own default formatting if notCan we really, truly blame the mobile browser makers for resorting to 2 and 3, which are definitely breaking web standards by choosing the screen stylesheet? After all, any real browser that wants to find a commercial niche by serving user needs must work on the real web and what's available on it . If 95% of all web pages ignore the honorable goals of media-neutrality, mobile stylesheets and so on, why build a browser with focus on the 5%? Conversely, in true chicken and egg fashion, many mobile developers might Steer Clear from Mobile Standards Done Right ... 'Cause Done Right, They Don't work.

Misunderstanding # 3: "Accessibility Means To Always Use Alt Text"

The meaning of alt text is to serve as replacement (hence, "alternative") when the image the HTML intends to serve can not be seen There's a variety of reasons for that to happen;. The user is blind, the medium does not support Images, the user disabled images on low-bandwidth, or the googlebot comes around to visit.

For example, when your image is a mere illustration to a point you're repeating elsewhere in the text, there's no need at all to use the alt text. Because the image is not crucial to understanding the point. Most people however at this point heard some rumors that the "alt tag" is increasing accessibility; and possibly, they've heard somewhere else that accessibility is professional these days and they also might want to see a tool-tip, not knowing that the title attribute would come in. handy for that (Wordpress in typical installations even creates an alt text based on the image's file name;. tools like Frontpage have committed similar silliness in the past). So, let's say our blog post is titled "New AJAX Flavor Discovered" and the illustration following the headline is a shrink-wrap box with the shiny colorful letters "AJAX," then repeating the letters AJAX in the alt text will result in something like this within alternative browsing contexts:

New Ajax Flavor Discovered Ajax

? Is this useful No - the point of the illustration was to use a recognizable catchy visual, or to suggest that AJAX is hyped as a shrink-wrapped shiny product; the point was not to clarify (in text) that the article is about AJAX As the headline already DID a Good Job at That.

In XHTML2, by the way, some of us may be able to get rid of the alt attribute altogether. Why? In XHTML2 you can use the "src" attribute on anything, including eg a paragraph. It's a bit like longdesc (today's link DONE RIGHT.

Misunderstanding # 4: "Sites Always Become More Accessible with CSS"

If I'D Have to make a bet, I'D SAY CREANG AN INACCESSIBLE WEBSITE CSS IS 10 TIMES As Fast As Doing The Same with Table Layout. You KNOW, You Just Need To Use An Incredibly Tiny Font in Your CSS and you ruined the reading experience for your visitors on thousands of pages (unless they're the 5% of visitors who know which button to press to increase the font size again, of course). Now try that with the nasty font tag ... even if you have a great template system, it'll take much longer! CSS on its own does not do much in terms of pushing accessibility. And table layout on its own also does not do much in terms of preventing it. Sure, it's better to have full control over the linear flow of the HTML (eg to put a long navigation to the left side via CSS, but make it follow the main content in the HTML for search engines, smaller devices, text-to-speech contexts And so on. But CSS is Ten Times As Fast ... for better, or Worse.

The biggest advantage of CSS is simply that it helps developers create websites much faster by separating layout and content As far as that's possible, and it's certainly not possible 100% -. Which brings us to our next point.

Misunderstanding # 5: "with css we're complesetly separating content and letout"

I'VE Completely Switch to CSS in Around 1998/1999. I'm still Happy I Was Able See "Old" HTML (Know your Enemy!). Back THEN, WHEN I SAW THE PROVER LIGHT, I FIGURED That CSS Enables you to completely separate content from layout. Put the h1 here, the address element there (is anyone still using that?), use instead of and instead of (and grok the philosophy behind that) SPICE IT UP WITH A DIV & SPAN & List, And Basically Markup Everything Based On Its Never-Changing Semantic / Structural Role, And You're Done.boy, Was I Wrong!

For starters, different browser quirks often need different HTML element wrappers. More importantly, and that one's true even in browser utopia (the place without quirks), once you realize you want to redesign a part of your site you also realize how many classes are Missing. Next to Creating a class in advance for everything imaginable (see the css zen garden), You're Basically Back to HTML.

CSS does not completely separate content from its layout -. Only a template system can do that CSS has its place on top of the template system, and greatly simplifies the HTML (if you think there's div soup today, you've got to see True 1996 Table Soup ... it's worse.)

Misunderstanding # 6: "with css, you can do the design later"

Actually, it's true. You can try to do your HTML structure first and then create the CSS as afterthought. You'll probably have a couple if iterations, going back and forth between the two, but you'll learn and adapt your processes in The fulure

THE REAL PROBLEM I'M Seeings Here, HOWEVER, IS That Some People - Heck, I Was Offen ONEL - TEND to Forget To Add A Fine-Tuned Design At All, Happily Using Valid HTML CSS AS Excuse for Not Having A page layout (relying on user stylesheets alone is not an option). Have you ever come across one of those black-on-white sites of nothingness, where the only graphical element is a "valid HTML" badge? (And no, I ' M NOT Talking About Well-Done Minimalism A La Joe Clark's Blog.) misunderstanding # 7: "The Web's Becoming More And More Accessible Every Day"

I think the biggest factor making accessible web sites a reality today is that most people simply do not do HTML anymore -. They use ready-made blog templates And several blog templates deliver good, strict (X) HTML.

However, there's another movement throwing needles at the high-flying balloon of accessibility, and partly, usability; it's The Return of JavaScript. (Episode III: A New AJAX) Now the rule of thumb should be this; put JavaScript on top of HTML to allow for features you otherwise would not have. Like nifty forms with auto-completion and such ... but importantly, auto-completion where the rest of the application still works as expected, including all kinds of keyboard shortcuts. Yet, we 're seeing the focus Turn Away from this Philosophy; Some Apps Even Put The "Ajax" Right Into their product name.

Google's Gmail, for instance, is a guilty pleasure, usability-wise. While you have a lot of features normal HTML could never offer (unless we're talking about some advanced, it's-the-year-2014 XForms browsers), you ' Re Also Offen Losing Out on Simple Things Like The Back Button. or Copy-Pasting of Whate You See On-Screen. (The List Goes On) NOW, The Gmail Team WAS wise enough to give us a second, plain-HTML version of their tool. But the fact remains that many web applications of today destroy a dozen features by introducing a dozen new ones. Whether or not that's simply the wave of the future and all good Remains to Be Seeen, But It's Not Accessibility In The True Sense.Misunderstanding # 8: "The Semantic Web Is Just Around The Corner"

Today, the W3C is putting much of its efforts behind the Semantic Web (also described by Tim Berners-Lee in the second part of his book Weaving the Web) But Cory Doctorow put it so well back in 2001:. People lie, and people are lazy. and I got a feeling even the W3C misunderstands why some of their web standards took off (they are relatively simple to apply, and certain complexities can be ignored without dangers), and I also got a feeling lower-case semantic web AIs , EG Google's Q & A Feature, Will Be Quicker to Show Results.

Mesunderstanding # 9: "CSS Hacks Are Always Superior"

Do you know how to Separate BetWeen Internet Explorer 6 and the rest? It's simple, just use the "! Important" Keyword, Like this:

.content {width: 600px! important; width: 580px;

Firefox and others will correctly interpret the content layer as to have a width of 600 pixels' Cause overrules IE6 on the other hand erroneously grabs the last width it sees.Or take this little hack. "Important!".:

.con / tent {width: 500px;}. Content {Width: 450px;}

This One is the g-z backslash trick, support to Separate Between Different Flavors of Msie. We used a lot of those in the stylesheets for porsche.com's relataunch.

? Those hacks are fun, sure, but are they superior to HTML table layout hacks Well, a little, but CSS hacks are still just that:. Hacks Workarounds that will cause troubles with every new browser Workarounds the new developer will not get. when you're away, unless she's a CSS expert So instead of thinking that CSS hacks are a great way of developing websites, it's better to use them sparingly and accept them as what they are:. an often necessary evil.

转载请注明原文地址:https://www.9cbs.com/read-133116.html

New Post(0)