Half-way thru new (650-page) Head First XHTML/CSS book. Completed first 7 chapters, which cover all things pertaining to HTML/XHTML (the *structure* of a web page, such as setting up » headings, paragraphs, images, links).
Chapter 8 (« 3-MB PDF), which I'm starting now, begins discussion of Cascading Style Sheets (CSS), which is cooler than (X)HTML, cuz it deals with *presentation* (as separated from structure).
Clearly tho, this book was written for those who know (absolutely) nothing about HTML or web site development (uh, not me).
To this point, I've (already) known most of what the book has been teaching .. tho the last few chapters, increasingly, have shed light on gaps in my knowledge. Examples of things I never knew:
••••• today's entry continues below •••••
- image <img> tags should go inside block elements, such as paragraphs <p>, and NOT stand on their own (as I've previously been known to do).
- the <blockquote> (which I like to use) should contain one (or more) block elements, such as the paragraph <p> (.. makes no sense to me).
- NO block elements (such as the <blockquote>) should go inside the paragraph <p> element (confusing, I know, in light of previously-mentioned item. Had to read it twice myself.)
- lists (both ordered and unordered, which this bulleted item is part of) should stand on their own and NOT go inside a paragraph <p>.
- image <img> tags should contain an ALT attribute (not optional, as I previously thought).
In the above examples, the word should means » in order to write valid XHTML mark-up. Browsers will display regardless.
Spent considerable time researching the <meta> tag, especially as it relates to character encoding and character sets (charset) .. specifically » IS0-8859-1 vs UTF-8, which is the default charset for XHTML. Long story short > best to use UTF-8 for XHTML.
Book spends much time espousing the advantages of XHTML (over HTML), none of which however, did I find very compelling .. such as (XHTML is...):
- newer (alas, newer is not always better)
- compatible with cell phones & other mobile devices (yeah, so what?)
- allows use of aural screen readers for the visually impaired (noble, but this probably doesn't represent a significant percentage of Rad readers)
- has XML's eXtensibility, including the ability to create new mark-up languages (not something I'm interested in right now. I have enough languages to learn already, thank-you.)
- compatible with XML-capable software (uh, like what?)
- makes it easy to put XML data on the web (too bad I don't have any XML data)
- will future-proof your web pages (this is the only advantage that really interests me)
Found it interesting that XHTML is really XML, not HTML (as I previously thought). This begs the question, then » why does every XHTML document begin (and end) with an <HTML> tag (called the root element), and not <XML> or <XHTML>???
One thing I *have* decided to do (since reading this book) is » begin writing all *new* web pages (such as the Guide to Norton Ghost 12) as XHTML Strict (not Transitional, as I was doing before). Just as easy to write new pages Strict, which will help me learn the language better.
More reviews on this book (146 of them) listed at » Amazon.com. Now on to Chapter 8 (« 3-MB PDF), Head First's showcase chapter.
UPDATE » Magoo wrote to say he heard (at SlashDot) the idea of HTML 5 is being kicked around by W3C .. as an interim step between HTML 4.01 and XHTML. See » Why HTML 5 matters .. and Web Forefront.
Said he also surfs the web on his PDA, and that Apple's new iPhone can surf HTML pages.
Comments (2)
Test comment.
Posted by Rad | July 25, 2007 10:03 PM
Posted on July 25, 2007 22:03
My experience is that it's a lot easier to produce valid code on hand-coded pages than it is with content-management systems like Movable Type and Wordpress. They usually produce valid XHTML Transitional, but as soon as you start adding modules or some fancy forms in your posts, you start getting bad code. I don't know about Movable Type, but this happens in Wordpress; even with the WYSIWYG editor off, paragraph tags are inserted automatically, which, though convenient, doesn't work with forms, as XHTML forms must be outside of paragraph tags for some reason. If I switch the header to XHTML Strict, I find that Wordpress uses some deprecated tags, so I can't validate without fixing the PHP code, instead of simple text editing.
The whole separation of presentation and content concept is taken a bit too far. Soon bold, italics, and underlining tags will be deprecated, which is a shame because they work so simply.
As long as the big players like Google, Yahoo, and Microsoft are using HTML 4, littered with errors, browsers, including cell phones, screen readers, and PDAs, will continue having to read through messes and support old standards, even if at great computational expense. Valid code is always important, as it (should) then be rendered properly in all browsers, but the book's future-proofing argument is on shaky ground; it's like saying that you should move all your data from CDs to DVDs because CDs are soon to be obsolete.
Still, it's good to be proficient with XHTML+CSS, and rigid, abstracted syntaxes are always fun. :)
Posted by Richard X. Thripp | January 26, 2008 7:45 PM
Posted on January 26, 2008 19:45