A blog about the things I'm into: computers, music, books, general thoughts ...and stuff

Wednesday, November 24, 2004

Summary of "Designing with Web Standards"

In the interest of spreading the word for web standards, I've written a summary of the main ideas that I have taken from the book
Designing with Web Standards by Jeffrey Zeldman. Of course, this is no substitute for reading the book, and some of the points are my own interpretations of the concepts presented in the book.



  • Web developers have acquired bad habits due to old browsers' poor support for standards (HTML, XHTML, CSS, W3C DOM, XML)

  • Most people are now using reasonably recent browsers with decent standards support.

  • Stop designing for the lowest common denominator browsers. Design for standards and let the design degrade gracefully in old browsers. It may not "look the same" but the content should still be accessible.

  • Use valid HTML/XHTML to mark up the content semantically (by its meaning). Note that there are probably many HTML elements that you do not normally use that you should consider e.g. <label> <th>. Familiarise yourself with the full range of semantic elements.

  • Avoid using deprecated elements unless absolutely necessary.

  • Use the correct DOCTYPE to ensure browsers switch into standards-compliance mode

  • Preferably use XHTML

  • Use CSS to style the content

  • Validate your HTML and CSS (http://validator.w3.org/ and http://jigsaw.w3.org/css-validator/)

  • Only use tables for layout if absolutely necessary. Layout can be achieved using CSS, however sometimes a transitional approach is required with some table-based layout.

  • Use CSS layout templates that have already been tested for cross-browser compatibility

  • Avoid "div-itis"; Don't use a div if there is an appropriate semantic HTML element

  • Avoid "class-itis"; Don't apply classes to every element that needs some styling.

  • id is a very powerful attribute. It can be used for CSS styling of elements and their descendants, for navigating within a page, and for scripting via the DOM.

  • Preferably use an external CSS stylesheet as opposed to internal or inline styling.

  • Don't use JavaScript for functionality which can be achieved with CSS e.g. menu rollover effects.

  • If using JavaScript, ensure it degrades gracefully in older browsers e.g. A drop-list menu should be just a hierarchical list of links in the HTML.

  • If using the DOM, ensure you use only standard W3C methods not proprietary extensions.

  • Assign an id attribute to each structural area of the page, whether it is a div or a td (in a transitional table layout)

  • Then use descendant CSS selectors to style the elements within each area e.g. div#menu li a { color: red }

  • Use CSS to create a "print-friendly" stylesheet using the same HTML page (using the media="print" attribute). You can hide unwanted sections with {display: none}

  • When sizing fonts, ensure that you use a unit which is resizable (not px in IE)

  • Do not use points (pt) as a font unit except for printing

  • Do not use font tags

  • If you must use spacer images give them an empty alt tag: alt=""


Advantages



  • Smaller file sizes and CSS caching - saves bandwidth

  • Cleaner code

  • Easier maintenance - can completely change look of site just with stylesheet

  • Forward compatibility


Links



Wednesday, November 10, 2004

Firefox 1.0 Released... Dump IE!

If you are still using the most dangerous piece of software in the world (Microsoft Internet Explorer), it's time to follow the suggestion of the U.S. Dept. of Homeland Security and dump it in favour of a more secure browser.
Firefox 1.0 - Rediscover the Web Download Firefox now and experience the joy of fast, secure, tabbed browsing and more...

Monday, November 08, 2004

Stupid people voted for Bush

election results vs IQ - Stupid people voted for Bush

Thursday, November 04, 2004

To all the redneck in-bred born-again money-grabbing oil-loving ignorant idiotic asshole Republican voters...

FUCK YOU

Monday, November 01, 2004

A plea to the American Voter

As a citizen of "The Rest of The World®", I don't get a say in the outcome of the US presidential election, despite the fact that the outcome will affect me and all the other "foreigners".
So, I'd like to just state my support for John Kerry. I think the world needs a U.S. President who has experienced the horrors and mistakes of war first-hand and would not lightly send troops to war.
The Bush administration's personal vendetta against Saddam blinded them to the problems they would cause in Iraq and the massive setback this means to their own self-declared "War on Terror".
If they had concentrated on finding the leaders of Al-Qaeda instead of their blatant oil grab in the Middle-East the world would be a lot safer from the T-word.
And, maybe, working together with different countries around the world and the U.N rather than alienating them would create a more united and effective front against these extremist groups.
So, if you happen to be a swinging voter in the U.S., please have a thought for the rest of us and vote Kerry....