Archive for the ‘XTHML’ Category

The PSO is Getting Naked!

Tuesday, April 4th, 2006

April 5th is the first annual CSS Naked Day!

Welcome to the first annual CSS naked day which will be happening April 5th, 2006. The idea behind this event is to promote Web Standards. Plain and simple. This includes proper use of (x)html, semantic markup, a good hierarchy structure, and; well, a fun play on words. I mean, who doesn’t want to get naked?. Feel free to see the original reference article for more information.

Smuggling Proprietary CSS and the Validity of the Validator

Thursday, February 9th, 2006

Will makes an interesting point in his blog post about using browser-specific CSS and still having webpages validate. His quandry:

Have you ever been tempted to use a CSS property such as -moz-border-radius, but can’t stand the thought of having a page that refuses to validate?

He can’t add it to an external stylesheet through <link>, nor can he use it internally within <style>; if he does, neither will validate.

However, adding the proprietary CSS to a style attribute on an element gets around the problem, since the W3C HTML validator does not check the validity of CSS within style attributes.

Observe; the code below uses the -moz-border-radius, but the resulting HTML will still validate.

The code:

<div style="padding: 0.25em 0.5em;
   border: 2px solid #605953;
   -moz-border-radius: 25px;
   background: #f1efec;">
Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
</div>

The result:

Lorem ipsum dolor sit amet, consectetuer adipiscing elit.

On the one hand, it’s a neat trick (not necessarily a hack) that gets around the validator and allows a developer to use non-standard styles on his page. On the other hand, that’s exactly it: it’s non-standard; and I agree whole-heartedly with Will, who so colorfully elucidates:

Yeah, it is kind of an ugly method, but you shouldn’t care since if you’re going to use it, right? After all, depending on proprietary CSS is like depending on a rotten wood catwalk over a tank full of the proverbial kind of bovine fecal matter.

All of the above got my brain thinking about validation and standards.

The W3C Validators are not the end-all-be-all definitive sources for creating standards-based websites. As Will (and now I) have successfully pointed out, proprietary (and, in most cases, non-standard, non-valid) code can be “smuggled” into a website and can trick the validators into thinking the code is perfectly valid.

The point is that standards are about much more than just validation. They are also about what works for you. You may have a certain work ethic, i.e. a personal standard, that no one else has heard of, let alone uses for himself. Does that make your work ethic any less valid? Pft. Of course not.

Any Joe with an Internet connection and a text editor can create a page that validates and claim it’s “standards-compliant”. As Mike Davidson wrote almost twenty months ago:

Web standards are about all the processes involved in publishing information over IP. [...] Just because you can validate your code doesn’t mean you are better than anybody else. Heck, it doesn’t even necessarily mean you write better code than anybody else. [...] Spewing validation manifestos on message boards isn’t going to show you how to listen, negotiate, compromise, and execute.

Excel to HTML: Lickety Split and clean as a whistle

Thursday, December 22nd, 2005

I frequently get information for our site at work in an Excel file. This leaves me with two options. The first is to save as HTML and wade through hours of trash markup. It’s no secret that Microsoft Office documents saved as web pages create messy markup. This is tedious and takes forever. The second is to copy and paste into a text file and add my own markup. This option isn’t much better. It takes equally as long and there is a good chance you’re going to miss tags throughout the document.

There is a feature in Dreamweaver though that can help turn an ginormous task into a teeny one. Export your Excel spreadsheet as a comma delimited file. Then back in Dreamweaver select Insert -> Table Objects -> Import Tabular Data. Then you’ll select the delimited file. There will probably be some amount of column removing and row deleting. In the end you have a cleanly, and more importantly, quickly, marked up table.

Combine this with some CSS and a nice DOM script like Splintered Striper and you have an attractive, easily updated HTML table. This comes in handy if it’s information that is modified frequently.