View Stylesheet Instead of View Source

Album Cover: Begin To Hope

"On the radio, you hear November Rain. That solo's awful long, but it's a good refrain."
Regina Spektor / On The Radio

Posted on September 03, 2004 9:23 AM in Browsers
Warning: This blog entry was written two or more years ago. Therefore, it may contain broken links, out-dated or misleading content, or information that is just plain wrong. Please read on with caution.

There was a whole lot of hooplah lately about the idea of Firefox developers removing the Page Source option from Firefox's View menu. Since then, things have calmed down a bit, and people everywhere seem to be breathing a collective sigh of relief.

I got to thinking about the whole thing this morning, and came to the conclusion that View Source (excuse the terminology, but it has stuck with me since my Internet Explorer days) isn't as useful as it once was. The prevailing argument for including the View Source option in a web browser is so that aspiring web developers can look at websites they like, and learn, from the source, how to design and develop websites on their own.

Jumping out of the last millennium and into this one, though, it becomes quite apparent that you can't always (in the best cases of web design, which are the ones most likely to have their source viewed) count on the main HTML source to tell you a whole lot about how a page was designed. Nowadays, as more and more major (and minor) websites are conforming to web standards, the structure of the page becomes more irrelevant, and the stylesheet(s) used become increasingly more important.

For instance, go ahead and view the source of my blog. If you use any of the same techniques I used in your own page, you'll get a pretty ugly web page that looks like it's straight out of 1995. However, if you ignore my actual XHTML source and focus more on one of my stylesheets, you can learn a heck of a lot more about what actually went in to designing my page. And the same thing goes for sites like Stopdesign and mezzoblue (i.e. sites you actually would, or at least should, be interested in learning from).

So what I'm proposing here is simple. Browsers should allow curious website visitors the option to View Stylesheet either in addition to or in place of View Source. This is easier said than implemented, of course, because sites can have several stylesheets whereas they only have one finite chunk of source code. However, UA developers have tackled much harder problems, so I don't see this hurdle as a very limiting one.


Arcanius on September 03, 2004 at 11:09 AM:

Firefox's Web designer plug in has this capability, and you are right, it is of extremely useful. But view source I find most useful for checking out how my OWN sites are doing things. For example, if I miss an HTML tag in a PHP script, it is not always apparent where the flaw is from the W3C validatior, since the PHP script lines don't match up to the HTML output lines. Only by viewing the source (in an easy-to-access manner, preferably) can I track down the problem easily. So I vote for a view CSS "in addition to" instead of "instead of." And really, it shouldn't be to hard to implement, even for styles in multiple places, because at some point, the browser brings all the styles together to parse them itself, so this is the preferred hook point for the view CSS, I would assume.


Kiarra Parker on September 30, 2004 at 3:41 PM:

"Nowadays, as more and more major (and minor) websites are conforming to web standards, the structure of the page becomes more irrelevant, and the stylesheet(s) used become increasingly more important."

Not entirely true. Sometimes pages /aren't/ coded in a way that anyone would want to learn from. Rather than disabling styles, which may not solve the problem, I frequently highlight the offending region and View Selection Source to find what's wrong, read what I couldn't see, get the URL of the nonfunctional link, etc.

And besides, a good result of the switch to web standards is that viewing the source of things can sometimes actually offer semantic meaning. Inept styling can make this type of problem bearable.

'Course those aren't the only reasons. Maybe I'm the only geek who does it, but I sometimes like to see meta information in the header that most browsers don't offer to users. Or look for easter eggs (a dying fad?).

And the traditional use is not completely outdated. For example, lemme highlight this form... View Selection Source... Oh, so you do it with <p>'s and <b>'s. Okay. I tend to do it with <label>s.

...Then of course there's checking DOCTYPEs out of idle curiosity, or looking at the source to see why some app or action isn't working with a particular page. Why not? The page was made to be downloaded, parsed and perused, wasn't it? Too bad it became a huge argument, I wouldn't have thought it worth the conflict.

Happy blogging!


Post Comments

If you feel like commenting on the above item, use the form below. Your email address will be used for personal contact reasons only, and will not be shown on this website.


Email Address:



Check this box if you hate spam.