This is more a general question about how you use CSS than about a specific technique.
I make a habit of from time to time looking at the code in popular and/or cool-looking and/or horrible sites, to see what other people are doing or not doing and what seems to work. I also do this because I frequently am brought in to work on a project that someone else left, and I need to be able to figure out what they might have been thinking so I can unscramble it. Recently I was looking under the hoods of a bunch of high-traffic sites http://datagnostics.com/design/topsites.html and I'm trying to figure out what's going on with them, and why they're not doing what I'd expect. What I would expect if I were building a site logically is: a. a doctype b. styles in .css sheets c. linked in the header directly or by @import d. no styling or formatting codes elsewhere Only two of these big sites don't even have a doctype: Google and Amazon. In Google's case I'm guessing it's because they place the highest priority on fast-loading pages, and they don't want *anything* in there they don't have to. In Amazon's case I'm inclined to think it's because the code is an incredible kluge job, put together over a long period by many hands not all working in the same direction, and the thought of a doctype just makes the coding dept. laugh hollowly. What surprises me is how many sites have style codes directly in the head, either instead of style sheets or in addition to one. Is there a good reason for this? Do you-all think the head styles are coming in via server side includes, and are SSIs faster than links or @import? Or are they using some sort of templating, so that the head styles are in before they even get to the server? All of these sites are, by definition, under much higher than normal server pressure. And then there's something like MySpace, with linked style sheets in the head, *and* some styling directly in the head, *and* styles on individual page elements. Is there any way in which this is a good thing? or should I stick with my original impression, which is that it's about what I expect from MySpace. I'm impressed that 3 of these sites pass the validator. I was expecting it of Wikipedia, but not of MSN or BBC -- it speaks, I think, to a high level of consistency and discipline in their coding depts. Mary Ellen Doctor Science, MA datagnostics.com ______________________________________________________________________ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
