HTML & XHTML: The Definitive Guide
When you write in HTML, you use ‘tags’ to surround your content and information about your content, in order to display them in some way to web browsers. A web browser is anything that reads your HTML files: it might be a graphical web browser such as Netscape or iCab, or it might be a voice reader used by the blind, or a search engine’s spider, or a web-enabled PDA. If you use intelligent choices in your HTML design, you’ll be able to handle all of these, and even browsers that haven’t been born yet.
Few, if any, of the inexpensive or free web page editors can produce this kind of widely-accessible HTML code. Front Page, perhaps the most widely-used of the free editors, has a reputation for producing HTML that can’t be read by anything other than Internet Explorer on the platform the code was produced on, and sometimes not even that!
If you want to produce web pages that increase your readership, you either have to purchase a more professional web page editor, or learn to create the HTML yourself, or, more likely, both. Fortunately, while sometimes tedious, HTML is not hard to understand. As long as you understand that you are surrounding information with tags that describe the information, everything else can be looked up in references such as this one.
All of your content has to be surrounded by something. You designate that your web page contains web page content by surrounding it with <HTML> and </HTML>. The ‘HTML’ tag ‘describes’ an HTML page. HTML tags are a keyword surrounded by a less than symbol (<) and a greater than symbol (>). The ending HTML tag also has a ‘/’ before the keyword.
There are two sections to your web document: the header, which contains information about the document, and the body, which contains the information you wish to convey—usually, the text that people will read. The header is surrounded by the HEAD tag, and the body by the BODY tag. You set the title of your document (in the header) with the TITLE tag. You set your main headline with the H1 tag and your paragraphs with the P tag. For example:
[toggle code]
-
<html>
-
<head>
- <title>HTML Guide Review</title>
- </head>
-
<body>
- <h1>FireBlade Coffeehouse HTML Guide Review</h1>
- <p>I’ve never found an HTML book that I’ve considered great. This one is probably the best. It covers just about everything in HTML, as well as a little bit of Cascading Style Sheets.</p>
- </body>
-
<head>
- </html>
This is a full, if extremely simple, HTML page. Notice that every beginning tag has an ending. In HTML this is not always the case, though it usually is. In XHTML this will be always the case.
“HTML & XHTML: The Definitive Guide” includes a “Quick Start” chapter that goes into this in more detail, as well as describing content-based text styles that can emphasize words, and how to make hyperlinks.
The book has a small chapter on using Cascading Style Sheets as well. Style sheets allow you to describe the physical layout of your web page. While HTML is designed to describe what the content ‘means’ so that the browser can determine the best way to display it, style sheets let you tell specific kinds of browsers how they ought to display your page. Obviously, you cannot create style sheets for all browser types; those browsers you don’t provide a style sheet for will use the HTML to determine physical presentation.
For example, the EM tag emphasizes text. By default, visual browsers will often italicize emphasized text, and voice readers will aurally emphasize the text. With a style sheet, you can specify that all emphasized text be displayed underlined in blue, or in slightly larger font size, or using a different font. Clearly, a black and white PDA or a voice reader will ignore the instructions to display emphasized text in blue, but they will still be able to emphasize the text on their own. Style sheets thus very nicely complement HTML. This book does not go into detail on style sheets; to do so would have made the book prohibitively large. O’Reilly has a separate book on style sheets that you’ll find invaluable if you need to control the physical layout of your pages. Most of the time, and especially as you start out, you don’t need to. Specify the content’s meaning, and let the browser determine the best way to display it to the reader.
This guide is comprehensive. It covers standard HTML as well as the special tags created by Netscape and Microsoft. It goes into detail on using frames, forms, and tables. It even covers the most basic Javascript (a mouse-sensitive image is one example) but if you wish to use Javascript you’ll want a Javascript guide in addition to this book.
There are problems. In some places it is surprisingly non-comprehensive; in others, it makes strange statements. For example:
- In the section on ‘meta’ tags, the ‘keywords’ tag is mentioned, but the ‘description’ tag is not, and there is no list of commonly-used meta tags. Both keywords and descriptions are important tags for search engines.
- In the section on the deprecated ‘compact’ tag for definition lists, it states that “few browsers, if any, honor this attribute”. Well, Netscape has since at least version 2, and up to 4.05. (Deprecated means it will disappear from the HTML tagset eventually. Browsers no longer have to support it; in this case, it has been replaced by a style sheet property.)
- The chapter headings are on the inside of the page instead of the outside! You can’t flip through this book to quickly find a topic. When you’re not sure exactly what section you need, flipping quickly through can be an easy way of getting an idea.
On the other hand, just because this book sucks (I’m exaggerating), doesn’t mean you shouldn’t buy it. It sucks less than any other HTML book I’ve seen. It is the best I’ve seen, and if you write HTML you do need a reference. I recommend this one. If you don’t know HTML, and you design web pages, you should learn it, because what you learn will inform your choices for web design. Start from one of the many on-line HTML tutorials, and, if you like what you see, get a good reference such as this one.
- HTML & XHTML: The Definitive Guide•
- This HTML guide sucks less than any other HTML book I’ve seen. If you design web pages, you should learn HTML, because what you learn will inform your choices for web design.
More HTML
- Nisus “clean HTML” macro
- The Nisus macro language is Perl; this means we can use all of Perl’s strengths as a text filter scripting language in Nisus.
- Flash on iPhone not in anybody’s interest
- Flash on iPhone is not in the interest of people who buy iPhones. The only people who really want it are poor web designers who can’t get out of 1992.
- Web display of Taskpaper file
- It is easy to use PHP to convert a Taskpaper task file into simple HTML conducive to styling via CSS.
- ELinks text-only web browser
- If you need a text browsers on Mac OS X, the ELinks browser compiles out of the box.
- iPhone development another FairPlay squeeze play?
- Why no iPhone-only applications? Is it short-sightedness on Apple’s part, or are they trying to encourage something big?
- Six more pages with the topic HTML, and other related pages
More programming books
- 42 Astoundingly Useful Scripts and Automations for the Macintosh
- MacOS uses Perl, Python, AppleScript, and Automator and you can write scripts in all of these. Build a talking alarm. Roll dice. Preflight your social media comments. Play music and create ASCII art. Get your retro on and bring your Macintosh into the world of tomorrow with 42 Astoundingly Useful Scripts and Automations for the Macintosh!
- Learning Python
- If you’ve been looking to learn Python, or need a new language with clearly defined scope and easy objects, this is an extremely useful book.
- AppleScript: The Definitive Guide
- AppleScript is an extremely useful tool for automating the repetitive things you do in Mac OS X applications, as well as for tying a long workflow together into a double-clickable icon. This Definitive Guide is a great reference for the AppleScript scripting language.
- Webmaster in a Nutshell
- Without doubt the best reference work for webmasters that you’ll find. It contains the “reference” part of most of O’Reilly’s web-relevant nutshell books. You can find references for HTML 3.2, the CGI standard, JavaScript, Cascading Style Sheets, PHP, the HTTP 1.1 protocol, and configuration statements and server-side includes for the Apache/NCSA webservers.
- Perl Cookbook
- This is probably the most useful Perl book I own. Whenever I need a solution quickly--which is often here at the University--I am very likely to find my start in the Perl Cookbook.
- One more page with the topic programming books, and other related pages