The Artima Developer Community
Sponsored Link

Weblogs Forum
Web Standards: Only Less of a Mess

14 replies on 1 page. Most recent reply: May 9, 2007 7:36 PM by Michael Gratton

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 14 replies on 1 page
Bruce Eckel

Posts: 875
Nickname: beckel
Registered: Jun, 2003

Web Standards: Only Less of a Mess (View in Weblogs)
Posted: May 4, 2007 3:41 PM
Reply to this message Reply
Summary
I've just finished reading Jeffrey Zeldman's book "Designing with Web Standards" (New Riders 2003), and it has answered a number of questions and dashed a fair number of my hopes for actual standard standards in the near future.
Advertisement

The book was recommended by one of the attendees of the Programming the New Web conference. The promise of web standards seems to be this: you give the right XML tag to force the browser into "Standards compliance mode" mode, then use CSS, and your pages will look the same across all browsers.

This lovely idea got me very excited when I first heard it at the conference, and I have had some success creating pages this way. But I've also found that the promise is far from fulfilled, and achieving pages that just work reasonably across browsers doesn't happen just by adopting XHTML and CSS. Far from it.

Let me first say that I'm mostly amateur when it comes to building web pages. I've created all the pages and markup on my own site, but I don't do it day-in, day-out as a job. In addition, I am empowered to make decisions like "it's too hard to make this layout work across browsers, so I'll change the layout to something that will work more reasonably." Whereas the professional site builder will probably have to make the layout work rather than changing the layout, which could mean some heavy-duty head banging.

Also, I've found the use of CSS to be an interesting and diverting challenge, kind of like doing a jigsaw puzzle is for some people. So I end up spending far too much time just playing with a single page in order to understand the CSS issues and make it come out decently. In my own mind I don't consider this time to be lost, because I can chalk it up to "research," and I believe that what I learn will continue to pay for itself in one form or another over the years.

The upshot is that, with XHTML and CSS, it's now possible to produce documents that work reasonably well across browsers without having to embed all kinds of messy browser-specific code. But the result is a bit like Java: the promise was "write once, run everywhere" and the reality was "write once, test everywhere." And to get things to actually work across browsers, you have to learn the tactics that work the best, and this learning process appears to happen on an individual, trial-and-error level.

I would go further and say that the whole web is a mess. CSS and XHTML are great but it's still "write once, test everywhere" at best. Plus now we have the IE "protected content" issue which makes the visitor click 3 times every time they go to a page that has Javascript on it. So the web is still a mess, but less of a mess -- we've seen definite improvements.

Sometimes it's hard to tell whether it's worse, on a complex layout, to struggle with styles or to use old HTML and try to force everything into place. Because of this, I'd say that web standards haven't lived up to their promise yet. If they ever do, then it should be unquestionably obvious that you should always use XHTML and CSS on all projects.

On that note, despite the CSS goal of eliminating table-based markup, it appears that there are still times when resorting to tables is the best solution, albeit in concert with CSS. One example I encountered was in creating radio buttons with button descriptions that were long enough to wrap. In order to get the descriptions to left-align, I ended up using a table. Despite that, it's clear that the results of occasionally using tables are far cleaner than the old way of using tables everywhere.

Unfortunately, CSS, as I shall describe below, is a mish-mash that requires you to remember lots of special cases. Even though it's significantly less bad than old HTML, it's really unfortunate that they couldn't have gotten in right this time.

The Book

First, some comments about Zeldman's book.

Roughly the first 1/3 of the book is almost a guide for selling web standards to your non-technical manager. If you already buy into the idea of web standards, this can be safely skipped in favor of the second 1/3, which introduces the meat of the issues and how to use the technology -- and how the technology is supposed to work. The last 1/3 of the book goes into all the gotchas about how the technology really works, and a number of workarounds that may be obsolete by now.

Although Designing with Web Standards is an excellent book from the standpoint of content, historical perspective and practical information, it is somewhat dated in the browsers it talks about, but this doesn't really diminish the experience of the book.

What does diminish the experience is an excess of what I'll call the "I'm clever and funny" syndrome that I see in far too many technical books these days (even, unfortunately, in a lot of the newer O'Reilly books). I think it arose from books that were trying to gently prod beginners into learning frightening new technologies, and in those books it served a purpose.

But when you write a book that people want to read for information and you decide that they also want to help you try out your stand-up comedy routines, you are treading on dangerous ground. I would have appreciated a smaller book (believe me, I hope I never publish a 1482 page volume again) that didn't force me to scan for information ("is he saying something useful here, or is he just vamping?"). There are times when Zeldman will go on for a paragraph or two with attempted comical banter that adds absolutely no information, and the reader eventually learns to skip forward when these occur. But it does not serve the reader to force them hunt for information among non-information.

At one point, Zeldman seems to start becoming conscious of this. On page 308: "Gosh, that was quite a sentence. (Must. Delete. Overwrought. Sentence. Before. Manuscript.)" But alas, he and his editor both thought this was so hilarious that they left it in, along with the overwrought sentence. In fact, 5/6th of that whole paragraph was wasted time. (Please. Stop. Drivel.) Because of this, I would guess that the book might lose 1/4 of its pages in the next edition, especially with a better and more aggressive editor, and go from "good with annoyances" to "great."

Many of the browser discussions are dated and he talks a lot about browsers that are probably not used anymore. And although CSS can really reduce the bandwidth needed by your site, he goes a bit far in his zeal for smallness, to the point of making short unreadable URLs (often to load gif files that overwhelm the difference of a few characters in a URL), while at the same time making long, more readable names for styles -- which will be used at least twice, and sometimes many more times. Sometimes his lack of technological understanding shows in other ways; at one point he asserts that Javascript embedded in a page will "run on the user's hard disk."

Even though it (really) needs an update, and you have to wade through a lot of stuff that is no longer relevant along with a lot of mindless drivel that the author and editor should have removed, this is still a valuable book to read. A lot of things became clearer to me, especially about CSS, that the other CSS references I have couldn't seem to convey. And the overall understanding of the issues and the big picture of the state of web standards is invaluable.

CSS Has Plenty of Quirks

Possibly the biggest problem is that CSS features don't apply orthogonally. That is, you can learn a feature that works in one situation, and then assume it should work in another situation, but it doesn't. For example, changing the text size seems like it should apply in all situations, but if you try it in a a:hover style, the text size doesn't change when you hover the mouse over a link. There's nothing like seemingly straightforward rules with lots of exceptions to make an apparently simple system ver complicated.

Not to mention the whole testability issue. No one was thinking about testing when they created HTML, and they didn't seem to think any more about it with CSS.

I'd still like really basic things, like some standard way to include other HTML files, and ways to create the equivalent of functions.

Div and span can produce different behaviors under IE and Firefox -- if you start changing DIVs to SPANs you can find elements jumping to different parts of the pages depending on which browser you're using.

And here's a huge question: why do I have to use DIV and SPAN to delimit styles? Why can I create <MYOWN> tags?

CSSZen Garden pages don't all work with Firefox, and I suspect they don't all work with IE.

The <q> quote tag works with Firefox but not with IE. This produces typographic ("round") quotes.

You can center text, but as far as I can tell there's no CSS way to center any other components. The best I could find is to add 'align="center"' as an attribute of the div tag. If so, it's odd, because you're supposed to be able to do everything with CSS that you formerly used HTML markup for.

In Firefox, you can go to the "Tools" menu and select "Page Info" to see what mode a particular page is rendered in. As far as I know, there's no way to do this in IE.

The CSS2 "Content" tag -- a very good idea, and why did it take them until CSS2 to figure it out? -- is not supported yet in IE. So it's basically useless because they didn't think of it until CSS2.

I've had borders that disappear when going from web view to print. Usually the solution is to add more margin, but you'd think that if it shows up in the browser, it ought to print as well.

I've also had borders appear when some unrelated change happened. I would end up spending a lot of time tracking down where the problem was (in one case it appeared to be a browser bug), and I had to then figure out some workaround, in one case by changing the border so that it was attached to a different style tag.

The real problem I see here is that behavior is not consistent, and often not associated with the style that I change. The application of styles ought to be logical, and yet they aren't because of odd behaviors. And what's worse, it's very difficult to tell whether I'm misusing the styles or whether there's a bug in a browser, or worse -- both.

Here's another one: if you define a style id for the HR tag and give it a left margin and width, it behaves differently between FireFox and IE; it's in noticeably different positions. But if you use a plain HR tag and surround it with a style that has a left margin and width, it behaves the same in both browers. I've been running into issues like this all the time, and I've yet to stumble across any writing about "practices that work." Everyone just seems to treat all approaches as if they will produce the same results.

Positioning can be done in a myriad number of ways, kind of like Perl: "there's more than one way to do it," so you're left wondering what the best way is. Well, for some kinds of positioning you get radically different behaviors between IE and Firefox. The positioned elements will appear in completely different parts of the page.

I ended up having the most success when trying to arrange text blocks across a row by using "align:float" and setting the left-margin for each element. That produced very consistent results between IE and Firefox. But I only got to this by trial and error; all the docs and books that I looked at (except Zeldman's) gave the impression that you could achieve the same results regardless of what technique you used, and none that I saw suggested that "align:float" would give consistent results for positioning.

I'm guessing that, because of the mess of early HTML days, everyone who learns to build pages just goes through this process and figures out the necessary bag of tricks, and so the authors of the books that I perused never thought of saying "here's what it would appear you can do with any technique, but here's the technique that works best." Admittedly that would take a lot more work, and I know whereof I speak when I say I understand how someone would back away from such a task. It's easy to get started on a book, then discover how much work it's really going to be, then look at how much you're really likely to get and decide that it's not worth the extra effort. (Which is why you should never write a book for the money you'll get from the publisher -- in this equation, only the publisher has figured out how to make books a profitable business).

Firefox handles fonts very differently than IE; one example is sizes. You can't make a font any smaller in FireFox than its standard size. So it ignores font sizes like 75% and 0.75em. It also ignores the font size keywords xx-small, x-small and small.

I wonder about web editing systems, such as DreamWeaver and the like. Do they generate web standard code? It seems like it would be much, much easier to create a web editing system that used standards, because the code generation seems like it might be much easer.

Nonetheless, I'm Not Going Back

So the best you can do, without making a complete mess of things trying to make it look identical across browsers, is to get it to look tolerable in multiple browsers. This will often require some compromises.

It's possible to design around issues, usually by simplifying your design (assuming you are in a position to make that choice). However, if I get into a situation that requires anything fancy, at this point I'm not going to try to jump through all the browser hoops; instead I'll build it with Flash using Flex.


Jason R Briggs

Posts: 3
Nickname: jasonb
Registered: Jul, 2005

Re: Web Standards: Only Less of a Mess Posted: May 4, 2007 4:20 PM
Reply to this message Reply
> <p>You can center text, but as far as I can tell there's
> no CSS way to center any other components. The best I
> could find is to add 'align="center"' as an attribute of
> the div tag. If so, it's odd, because you're supposed to
> be able to do everything with CSS that you formerly used
> HTML markup for.

I'm not entirely sure that's true. The CSS way to center other components is text-align: center as the style of the div, and that will center the contents... if (and it's a big if), your doctype is correct.

I wasted a good couple of days trying to reliably center a div inside a div that worked consistently on all browsers (or at least on IE and Firefox), and I discovered a lot of my problems abruptly went away when I set the doctype to strict:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

Of course, that added a bunch of other problems. But it fixed the centering.

David Buxton

Posts: 2
Nickname: buxtobox
Registered: Apr, 2007

Re: Web Standards: Only Less of a Mess Posted: May 4, 2007 11:32 PM
Reply to this message Reply
The "official" method for horizontally centering a block is to set the left and right margins to auto.


<p style="width:50%; margin-left:auto; margin-right:auto;">Centred</p>


As ever, Windows Internet Explorer gets it wrong. In which case you use text-align:center; on the containing block.

http://bluerobot.com/web/css/center1.html

Dick Ford

Posts: 149
Nickname: roybatty
Registered: Sep, 2003

Will always be a mess Posted: May 5, 2007 12:44 AM
Reply to this message Reply
Bruce, I'm pretty much in the same boat as you. I've actively avoided web development for years, but avoidance is almost a losing proposition for many developers. So lately I've been devouring books on HTML and CSS. At least I know what's going on now, and I understand how to get your traditional three column layout up without resorting to tables and just using CSS.

But what a freaking mess. Just like I'd rather someone write a compiler for me, I'd rather someone else deal with that mess and hand me some high-level components that hide browser differences from me.

Ideally, I would use something like GWT or Echo2 for "apps", but of course most shops figure that a designer has to fit in there somewhere, so we're still left with markup.

Given the opportunity, I would just move on to Flash or Silverlight.

Andy Waite

Posts: 1
Nickname: andywaite
Registered: May, 2007

Re: Web Standards: Only Less of a Mess Posted: May 5, 2007 9:02 AM
Reply to this message Reply
A second edition was published in 2006. I haven't read it though so don't how it compares to the first.

Hector Santos

Posts: 6
Nickname: hector
Registered: May, 2007

Re: Will always be a mess Posted: May 6, 2007 11:42 AM
Reply to this message Reply
> Bruce, I'm pretty much in the same boat as you. I've
> actively avoided web development for years, but avoidance
> is almost a losing proposition for many developers.
>
> ...
>
> But what a freaking mess.
>
> ..
>
> Given the opportunity, I would just move on to Flash or
> Silverlight.

Dick, Ha! Its funny you should say this, and in a way, you made my day - You're not alone!

I'm the CTO of what may be considered the "Last of the Mohicans" of the original successful multi-million dollar commercial BBS systems - WINSERVER (Wildcat! Interactive Net Server) or Wildcat! for short. Today we call them "social networks" and communities.

We continued to survive because, unlike the then past top competiting BBS systems, we successfully migrated to the internet with the 1996 port to Windows from DOS. Our #1 market is still dialup among companies and major corporations and this market subsidizes our dwindling low end "hobbiest" or small business market.

I partly blame that on having legacy and old "default" web pages. I personally did not want the product default web pages to be based on JavaScript - purely html and we relied on customers editing their own pages. But most people don't want that. They want everyting out of the box or easy WYSIWYG Web Development with plug and play pre-canned components.

So recently, we began to design the new interfaces with enhance interactive I/O, alittle bit of AJAX, but mostly concentrated on CSS.

And boy, what a MESS it all is!

We already have a Frontend GUI executable called WIldcat! Navigator, free for sysops and their end users. But people have to download this and most of it can now be done on the WEB. The irony is that to achieve this high level of WEB richness and connectivity, you need to download parts of these new systems too in order to make it all work.

So I'm now at a point where I need to decide between various web development technologies, methods or combinations and even possibly doing our own "wrapper" of development tools to support the different methods a customize may want to use. We need to single source it all on our side.

This might not be a bad idea because as I am finding out, this is exactly where all the players are doing or heading to - writing wrappers for wrappers for wrappers!! Geez!

I started researching all this "WEB 2.0" stuff, taking me to nearly every "Who's Who" blog in this Web 2.0 industry. That blog, this blog, that blog and finally this morning to David Ward's Google TechTalk video on Flex/Flash/Apollo which took me to David's blog and then a link to Bruce, and now I'm here at Artima talking to you fine folks.

All I can say, IMO, that it isn't stable - and its bound to get more confusing than less for the next 2-3 years. The bottom line seem to be the fight for Desktop "RUNTIME" engines.

Currently Adobe has a 90%+ of the Desktop "Video/Audio" web-based player market.

Microsoft now has "SilverLight" (in beta) and this will be burned into all future OSes and I won't be surprise it is made part of the new "security updates."

You got Chris Wilson (Microsoft IE) giving a mailing list speech about their industry delimas of being #1, their inner turmoils to remain backward compatible verus advancing with new standards; some of them, not all of them, maybe part of them, or some with a Microsoft twist, including fixing bugs as well as supporting bugs fixes which are now new pseudo standards such as the CSS MSIE kludges.

Then you got the Mozilla and what seems to be Google's new Browser A.K.A Firefox 2.0! and all the XMPP, XUL, GECKO, JNOS, etc WEB 2.0 technology that is being burned into thier browser and MUA (Thunderbird).

You have Adobe with its Apollo server, its new Media Player "Flash" version, its new formats ambitions (The FLEX SDK is now open source folks)...

So on an so on. All in all, its really a big mess.

Developer's woes should be the title of Bruce's next article. :-)

David Clarke

Posts: 1
Nickname: pigwin32
Registered: May, 2007

Re: Web Standards: Only Less of a Mess Posted: May 6, 2007 3:30 PM
Reply to this message Reply
Probably unnecessary but I absolutely agree about Zeldman's book. I've had a quiet rant in the past about how long it takes to get to the meat. Plus in the edition I read, Zeldman obviously struggled with the transition from web to print - it felt like he wanted to put links right in the text when they would have been placed to better advantage in a sidebar.

To get the goods on CSS I highly recommend Eric Meyer's book Eric Meyer on CSS (http://www.ericmeyeroncss.com/).

Dorian Gray

Posts: 7
Nickname: dgray
Registered: May, 2007

Re: Web Standards: Only Less of a Mess Posted: May 7, 2007 9:11 AM
Reply to this message Reply
Agree with Bruce.

1) these days authors are producing books with enormous page counts. Personally, I don't have the time to read 1000+ pages of books that cover just a sub-topic of web-based enterprise applications development. I prefer books that are brief and precise. I don't determine if a book is worth my money based on the weight of the book.

2) HTML/CSS/JavaScript based web development has compatibility and complexity issues. Add to that JavaServer Faces with the concept of pushing UI from the server side. IMHO, that is both inefficient and there isn't proper separation of concerns (i.e. UI and the Model). There is a need to develop purely browser based UIs that can communicate with the backend in a secure manner. I feel Flex/Flash provides that model of development.

Joao Pedrosa

Posts: 114
Nickname: dewd
Registered: Dec, 2005

Re: Web Standards: Only Less of a Mess Posted: May 7, 2007 2:44 PM
Reply to this message Reply
See these two:

<q from="http://developer.yahoo.com/yui/fonts/">
YUI Fonts CSS

The foundational YUI Fonts CSS file offers cross-browser typographical normalization and control. Fonts CSS:

* Offers full A-grade browser support.
* Provides consistent font sizing and line-height.
* Provides appropriate cross-OS font-family degradation paths.
* Supports user-driven font-size adjustment in the browser, including cross-browser consistency for adjusted sizes.
* Works in both "Quirks Mode" and "Standards Mode."
</q>

<q from="http://developer.yahoo.com/yui/reset/">
YUI Reset CSS

The foundational YUI Reset CSS file creates a level playing field across A-grade browsers and provides a sound foundation upon which you can explicitly declare your intentions. It normalizes the default rendering of all HTML elements, for example it sets margin, padding, and border to 0, font sizes to YUI Font's default, italic and bold styles to normal, and list-style to none.
</q>


You can't try to guess how things will look-like across browsers and across operating systems. Designers have found it important to reset some of the default configurations to make everything look almost the same everywhere, and this one by Yahoo provided me with one of those "Aha!" moments once I started using it. While you are at it, see their "CSS grids" for easy table-like layout for your site:

<q from="http://developer.yahoo.com/yui/grids/">
YUI Grids CSS

The foundational YUI Grids CSS file offers three preset page widths, seven core templates, and the ability to nest subdivided regions of one to four columns. All told, the file offers almost 200 preset layouts and an unlimited number of custom permutations that work across all A-grade browsers, all for less than 2.5kb of minimized file weight. Other features include:

* Supports fluid-width (100%) layouts.
* Supports preset fixed-width layouts at 750px and 950px.
* Supports easy customization of the width for fixed-width layouts.
* Flexible in response to user initiated font-size adjustments.
* Template columns are source-order independence, so you can put your most important content first in the markup layer for improved accessibility and search engine optimization (SEO).
* Self-clearing footer. No matter which column is longer, the footer stays at the bottom.
* Automatically centers within the viewport pages less than 100%.
* Accomodates IAB's Ad Unit Guidelines for common ad dimensions.
* Offers full A-grade browser support.
</q>


That is a start. For more complex, desktop-like applications, you could use the Ext javascript library, which was formally an extension to Yahoo's UI javascript/css library, but has since added support for other "Ajax" libraries as well. While it's not perfect, it's a start and I am adopting it, even though I have created my own wrapper for it. It's open source and commercial at the same time:

<q from="http://extjs.com/">
World-class JavaScript, Ajax and UI Components.
</q>


By adopting things like these, the Web can be made to work OK, while generally keeping the development dynamic and familiar enough.

Edwin Martin

Posts: 1
Nickname: edwinm
Registered: May, 2007

Re: Web Standards: Only Less of a Mess Posted: May 8, 2007 4:59 AM
Reply to this message Reply
I agree for some part.

CSS is a nightmare to learn. Before you can build what you want, you have to learn a couple of tricks that are poorly documented.

But browser support is getting better. When I build something in Firefox, it works 99% of the time in IE 7. That's good news. The bad is that currently IE 6 is still widely used, so I still have to spend a couple of hours to fix IE's bugs.

When IE 6 is gone (the sooner the better), the web will be a better place.

Ivan Lazarte

Posts: 91
Nickname: ilazarte
Registered: Mar, 2006

Re: Web Standards: Only Less of a Mess Posted: May 8, 2007 6:55 PM
Reply to this message Reply
it really isn't that bad. the web aware company knows how to make the compromises necessary to launch great looking websites without wasting forever on the front end.

regarding flash/flex/echo2 etc etc... never bet against lowest barrier to entry.

Christian Sell

Posts: 2
Nickname: csell
Registered: Jun, 2003

Re: Web Standards: Only Less of a Mess Posted: May 9, 2007 5:45 AM
Reply to this message Reply
So Bruce has finally discovered the subject of web standards and CSS. Only problem is that this subject is already several years old, and there is a lot more expertise to be found and listened to than that of a "Java Guru" that has had a first and necessarily superficial glance.

Being a "hard-core" software developer, I recently decided to go the same way as Bruce and read up on what this CSS stuff really is. However, it was clear to me that reading a few pages would not do. Rather, I picked up 3 books that claimed to go from beginners level to pro, and I found exactly the expert advice I had expected. I also found that there is a wealth of online resources that cover all kinds of CSS tricks and cross-browser hacks. You can be pretty sure that any problem you come across is already solved and well-documented.

The problem is that web design is an area of exertise all by itself. It takes a significant amount of time to get it covered, and anyone who does it well deserves their income.

Scott Sauyet

Posts: 1
Nickname: crosseye
Registered: Jun, 2003

Re: Web Standards: Only Less of a Mess Posted: May 9, 2007 11:35 AM
Reply to this message Reply
> The problem is that web design is an area of exertise all
> by itself. It takes a significant amount of time to get it
> covered, and anyone who does it well deserves their income.

I think this is the crux of the matter. These things take time and skill. I'm mostly a coder, but get stuck on web design at times and have learned some of the details of the web stack. Some of it is complex. Mostly, though, the expected behavior is pretty straightforward. It's the workarounds for the faulty implementations of the specification that cause most of the headaches.

But blaming the web standards or their evangelists for these problems is a bit like complaining that Java is unpredictable because you don't know if JNI is going to be included: after all, weren't there Microsoft implentations that didn't include it?

I have great respect for Bruce Eckel. TIJ is still the best Java book I've ever seen. But much of this seems off the mark to me.

I can't comment on the critique of the Zeldman book, as I haven't ever gotten around to reading it. But the specific quirks he mentions are in many cases simply wrong.


> [ I]f you try it in a a:hover style, the text size doesn't
> change when you hover the mouse over a link.

It works for me in FF, IE6 and IE7.


> Not to mention the whole testability issue. No one was
> thinking about testing when they created HTML, and they
> didn't seem to think any more about it with CSS.

It's not clear to me what testability means here. Browsers and other user agents are intentionally given quite a bit of latitude in how they display things. That things don't look identical in different browsers is not a bug. The fact that I can change default fonts, colors, sizes, etc. is a great feature, but it does make it hard to automate any testing of the resulting layout.


> I'd still like really basic things, like some standard way
> to include other HTML files

Like you can with plain text files? ;-)

HTML is about content, not process. Every server-side technology that generates HTML has inclusion mechanisms, but I don't really see why it should be part of HTML itselft.


> and ways to create the equivalent of functions.

In HTML? In CSS? I'm not sure what it would mean.


> Div and span can produce different behaviors under IE and
> Firefox -- if you start changing DIVs to SPANs you can
> find elements jumping to different parts of the pages
> depending on which browser you're using.

This is quite important, and quite right. DIVs and SPANs are among the few tags without any semantic content. They are here just for grouping content and applying styles and behaviors. There are two different ones so that you can have a block-level (DIV) and an inline-level (SPAN) version of a container with no intrinsic semantic content. They are not meant to be interchangeable. A DIV will (unless you override its "display" or "width" property) generate a block that spans the width of the window. A SPAN will flow inline with the surrounding content the way a STRONG tag would.


> [W]hy do I have to use DIV and SPAN to delimit styles?
> Why can I create <MYOWN> tags?

You can in XML, which will work with CSS too, albeit with more work. Some browsers will let you do in HTML documents too. Try this in Firefox:

    myOwn {
display: block;
border: 2px solid red;
}

<p>Just <myOwn>testing</myOwn> an extra tag.</p>



> CSSZen Garden pages don't all work with Firefox, and I
> suspect they don't all work with IE.

That is a showcase for what's possible with CSS. Most of the ones I've seen render pretty well in both browsers, but there are ones that take advantage of techniques not working properly in IE6. This is not a quirk of CSS, only of the IE6 implementation.


> You can center text, but as far as I can tell there's no
> CSS way to center any other components.

    margin: auto;



> In Firefox, you can go to the "Tools" menu and select
> "Page Info" to see what mode a particular page is rendered
> in. As far as I know, there's no way to do this in IE.

If I can do something in IDEA but not Netbeans is this then a quirk of Java?!!


> The CSS2 "Content" tag -- a very good idea, and why did it
> take them until CSS2 to figure it out? -- is not supported
> yet in IE. So it's basically useless because they didn't
> think of it until CSS2.

Are Java parameterized types useless because they didn't think of them until 1.5 and I'm working in an app server still on version 1.4? (And no cracks about whether Java generics are useful in any case, please! :-) )


> I've had borders that disappear when going from web view
> to print. Usually the solution is to add more margin, but
> you'd think that if it shows up in the browser, it ought
> to print as well.

And should your print view render at 72 dpi as well? Should the borders somehow be rendered in an aural browser too?


> The real problem I see here is that behavior is not
> consistent, and often not associated with the style that I
> change. The application of styles ought to be logical, and
> yet they aren't because of odd behaviors. And what's
> worse, it's very difficult to tell whether I'm misusing
> the styles or whether there's a bug in a browser, or worse
> -- both.

Yes, that's very frustrating. But you might best be venting your ire at Microsoft for its hitherto cavalier attitude to the standards and not at HTML/CSS themselves. There are of course bugs in other browsers, but IE, especially before version 7 has an order of magnitude more than the other major browsers combined.


> So the best you can do, without making a complete mess of
> things trying to make it look identical across browsers,
> is to get it to look tolerable in multiple browsers. This
> will often require some compromises.

Welcome to the web designer's world!

Ralph Kelsey

Posts: 1
Nickname: raoul444
Registered: Mar, 2006

Re: Web Standards: Only Less of a Mess Posted: May 9, 2007 7:07 PM
Reply to this message Reply
I want to add to your concern about the "for dummies-ization" of computer books. Even O'Reilly books, with the worst offenders being the otherwise excellent "Head First" series. They are about 25 to 33% lame attempts to be entertaining, which is way too much.

The gold standard for mixing content and entertainment is Don Knuth's books, particularly "The Art of Computer Programming", of which vols 4 and 5 are finally supposed to appear this decade.

Michael Gratton

Posts: 4
Nickname: mjg
Registered: Apr, 2003

Re: Web Standards: Only Less of a Mess Posted: May 9, 2007 7:36 PM
Reply to this message Reply
I think people just need to get over the whole "I want my site to look identical in every browser" thing that they always seem to be caught up in - it's just not possible.

Why? Because the CSS specs are huge and because there is more than one implementation of them. Your monitor DPI, resolution, colour space, model and manufacturer are different and that you are sitting a different distance from the screen than everyone else. Your system has a different set of fonts installed and different font rendering systems that are configured differently. Because of vision impairments. Because of Greasemonkey.

So what to do? Yes - turn on standards mode. Don't bother trying to fix the look in browsers that do not support standards. Test your look in the browsers you really care about - just to be sure. None of this is any different from normal software development practice (yes, building web sites is software development - it's not a graphic art). But above all, expect there to be inconsistencies - because there will.

CSS is a language for describing presentation, it does not specify how the presentation is implemented.

/Mike

Flat View: This topic has 14 replies on 1 page
Topic: Web Standards: Only Less of a Mess Previous Topic   Next Topic Topic: Old vs. New Marketing

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use