Html Xhtml Definitive Guide 6th Edition
Find helpful customer reviews and review ratings for HTML & XHTML: The Definitive Guide (6th Edition) at Amazon.com.


The Tag As defined in the HTML 4.01 and XHTML 1.0 and 1.1 standards, a tag divides your document into separate, distinct sections. It may be used strictly as an organizational tool, without any sort of formatting associated with it, but it becomes more effective if you add the id and class attributes to label the divisions. The tag also may be combined with the align attribute to control the alignment of whole sections of your document's content in the display and with the many programmatic 'on event' attributes for user interaction.
The align attribute The align attribute for positions the enclosed content to the left (default), center, or right of the display. In addition, you can specify justify to align both the left and the right margins of the text. The tag may be nested, and the alignment of the nested tag takes precedence over the containing tag. Further, other nested alignment tags, such as, aligned paragraphs (see in section ), or specially aligned table rows and cells override the effects of. Like the align attribute for other tags, it is deprecated in the HTML and XHTML standards in deference to stylesheet-based layout controls. The nowrap attribute Supported by Internet Explorer and Opera, but not Firefox or Netscape Navigator, the nowrap attribute suppresses automatic word wrapping of the text within the division. Line breaks will occur only where you have placed carriage returns in your source document.
While the nowrap attribute probably doesn't make much sense for large sections of text that would otherwise be flowed together on the page, it can make things a bit easier when creating blocks of text with many explicit line breaks: poetry, for example, or addresses. You don't have to insert all those explicit tags in a text flow within a tag. On the other hand, a large number of users with browsers that ignore the nowrap attribute will see your text flow merrily along.
If you are targeting only Internet Explorer or Opera with your documents, consider using nowrap where needed, but otherwise, we can't recommend this attribute for general use. The id attribute Use the id attribute to label the document division for later reference by a hyperlink, stylesheet, applet, or other automated process. In general, an acceptable id value is any quote-enclosed string that uniquely identifies the division and that later can be used to reference that document section unambiguously.
Specifically, the value must begin with a letter, and can contain letters, numbers, hyphens, colons, underscores, and periods, but not spaces. Although we're introducing it within the context of the tag, this attribute can be used with almost any tag. When used as an element label, the value of the id attribute can be added to a URL to address the labeled element uniquely within the document. You can label both large portions of content (via a tag like ) and small snippets of text (using a tag like or ).
For example, you might label the abstract of a technical report using. A URL could jump right to that abstract by referencing report.html#abstract.
When used in this manner, the value of the id attribute must be unique with respect to all other id attributes within the document and all the names defined by any tags with the name attribute. When used as a stylesheet selector, the value of the id attribute is the name of a style rule that can be associated with the current tag. This provides a second set of definable style rules, similar to the various style classes you may create. A tag can use both the class and the id attributes to apply two different rules to a single tag. In this case, the name associated with the id attribute must be unique with respect to all other style IDs within the current document. You can find a more complete description of style classes and IDs in.
The title attribute Use the optional title attribute and quote-enclosed string value to associate a descriptive phrase with the division. Like the id attribute, the title attribute can be used with almost any tag and behaves similarly for all tags. There is no standards-defined usage for the value of the title attribute, but current browsers display the title when the mouse pauses over that element—in this case, anywhere in the -defined text area. For example, use the title attribute to provide helpful tips within your document. The class and style attributes Use the style attribute with the tag to create an inline style for the content enclosed by the tag. The class attribute lets you apply the style of a predefined class of the tag to the contents of this division. The value of the class attribute is the name of a style defined in some document-level or externally defined stylesheet.
In addition, class-identified divisions lend themselves well to computer processing of your documents; for example, extracting all divisions with the class name 'biblio,' for the automated assembly of a master bibliography. The Tag The tag signals the start of a paragraph.
That's not well known even by some veteran webmasters, because it runs counterintuitive to what we've come to expect from experience. Most word processors we're familiar with use just one special character, typically the return character, to signal the end of a paragraph, not the beginning. By contrast, in HTML and XHTML, each paragraph should start with the paragraph tag and end with the corresponding end tag. Moreover, while a series of newline or return characters in a text processor-displayed document, created when the author hits the Enter key repeatedly, creates an empty paragraph for each one, browsers typically ignore all but the first paragraph tag, as well as newline characters. In practice, with HTML you can ignore the starting tag at the beginning of the first paragraph and the tags at the end of each paragraph: they can be implied from other tags that occur in the document and hence safely omitted. For example: This is the first paragraph, at the very beginning of the body of this document. The tag above signals the start of this second paragraph.
When rendered by a browser, it will begin slightly below the end of the first paragraph, with a bit of extra whitespace between the two paragraphs. This is the last paragraph in the example. Notice that we haven't included the paragraph start tag ( ) for the first paragraph or any end paragraph tags; they can be unambiguously inferred by the HTML browser and are therefore unnecessary. Function Defines a paragraph of text Attributes align, class, dir, id, lang, onClick, onDblClick, onKeyDown, onKeyPress, onKeyUp, onMouseDown, onMouseMove, onMouseOut, onMouseOver, onMouseUp, style, title End tag; often omitted in HTML Contains text Used in block In general, you'll find that human document authors tend to omit postulated tags whenever possible, and automatic document generators tend to insert them.
That may be because the software designers didn't want to run the risk of having their products chided by competitors as not adhering to the HTML standard, even though we're splitting letter-of-the-law hairs here. Go ahead and be defiant: omit that first paragraph's tag and don't give a second thought to paragraph-ending tags—provided, of course, that your document's structure and clarity are not compromised (that is, as long as you are aware that XHTML frowns severely on such laxity, too). Paragraph rendering When encountering a new paragraph ( ) tag, the browser typically inserts one blank line plus some extra vertical space into the display before starting the new paragraph.
The browser then collects all the words and, if present, inline images into the new paragraph, ignoring leading and trailing spaces (not spaces between words, of course) and return characters in the source text. The browser software then flows the resulting sequence of words and images into a paragraph that fits within the margins of its display window, automatically generating line breaks as needed to wrap the text within the window. For example, compare how a browser arranges the text into lines and paragraphs to how the preceding example is printed on the page. The browser may also automatically hyphenate long words, and the paragraph may be full-justified to stretch the line of words out toward both margins.
Figure 4-2. Effect of the align attribute on paragraph justification Notice in the HTML example that the paragraph alignment remains in effect until the browser encounters another tag or an ending tag. We deliberately left out a final tag in the example to illustrate the effects of the end tag on paragraph justification.
Other body elements—including forms, headers, tables, and most other body content-related tags—may also disrupt the current paragraph alignment and cause subsequent paragraphs to revert to the default left alignment. Note that the align attribute is deprecated in HTML 4 and XHTML, in deference to stylesheet-based alignments. The class, id, style, and title attributes Use the id attribute to create a label for the paragraph that can later be used to unambiguously reference that paragraph in a hyperlink target, for automated searches, as a stylesheet selector, and with a host of other applications. Use the optional title attribute and quote-enclosed string value to provide a descriptive phrase for the paragraph. Use the style attribute with the tag to create an inline style for the paragraph's contents. The class attribute lets you label the paragraph with a name that refers to a predefined class of the tag previously declared in some document-level or externally defined stylesheet. Class-identified paragraphs lend themselves well to computer processing of your documents—for example, extracting all paragraphs whose class name is 'citation,' for automated assembly of a master list of citations.
Allowed paragraph content A paragraph may contain any element allowed in a text flow, including conventional words and punctuation, links ( ), images ( ), line breaks ( ), font changes (, and ), and content-based style changes (, and ). If any other element occurs within the paragraph, it implies that the paragraph has ended, and the browser assumes that the closing tag was not specified. Allowed paragraph usage You may specify a paragraph only within a block, along with other paragraphs, lists, forms, and preformatted text. In general, this means that paragraphs can appear where a flow of text is appropriate, such as in the body of a document, in an element in a list, and so on.
Technically, paragraphs cannot appear within a header, anchor, or other element whose content is strictly text-only. In practice, most browsers ignore this restriction and format the paragraph as a part of the containing element.
Authors Chuck Musciano, Bill Kennedy ISBN Published 17 Oct 2006 Purchase online Plenty of books can teach you HTML quickly, getting you up to speed and hacking out Web pages in no time. HTML & XHTML: The Definitive Guide offers a more comprehensive and pragmatic look at the de facto markup language of today, as well as the emerging next step. This title systematically presents HTML markup, beginning with the basics-such as the anatomy of an HTML document, text, and links-and proceeding to cascading style sheets, JavaScript, and XML. Plenty of books can teach you quickly, getting you up to speed and hacking out Web pages in no time. HTML & XHTML: The Definitive Guide offers a more comprehensive and pragmatic look at the de facto markup language of today, as well as the emerging next step. This title systematically presents HTML markup, beginning with the basics-such as the anatomy of an HTML document, text, and links-and proceeding to cascading style sheets, and.
Along the way, it discusses related issues, such as problems with displaying background images, and browser-specific behavior with tables and other elements. Each element is covered in as much depth as is necessary to frame the key implementation issues. Most of the book is entirely relevant to basic HTML coding without any concern for XHTML. The latter, more cutting-edge flavor of markup is covered in depth near the end of the book. The entire specifications for the HTML 4.01 and XHTML 1.0 Document Type Definitions (DTDs) are included among the appendices. While HTML & XHTML: The Definitive Guide is an excellent tutorial for learning markup the right way, it is also a superb desktop reference guide to keep nearby for daily use. Perhaps, there is no greater compliment for a Web development book.
Plain Topics covered:. Markup basics. HTML document structure. Text handling. Images. Multimedia.
Links and URLs. Formatted lists. Tables. Forms. Cascading style sheets. Frames. JavaScript.
Applets and objects. Dynamic documents. Netscape Layout Extensions.
XML. XHTML,'.' Lucid, in-depth descriptions of the behavior of every HTML tag on every major browser and platform, plus enough dry humor to make the book a pleasure to read.' ' -Edward Mendelson, PC Magazine 'When they say 'definitive' they're not kidding.' ' -Linda Roeder, About.com Put everthing you need to know about HTML & XHTML at your fingertips.
Technical
For nearly a decade, hundreds of thousands of web developers have turned to 'HTML & XHTML: The Definitive Guide' to master standards-based web development. Truly a definitive guide, the book combines a unique balance of tutorial material with a comprehensive reference that even the most experienced web professionals keep close at hand. From basic syntax and semantics to guidelines aimed at helping you develop your own distinctive style, this classic is all you need to become fluent in the language of web design. The new sixth edition guides you through every element of HTML and XHTML in detail, explaining how each element works and how it interacts with other elements. You'll also find detailed discussions of (Cascading Style Sheets), which is intricately related to web page development. The most all-inclusive, up-to-date book on these languages available, this edition covers HTML 4.01, XHTML 1.0, and CSS2, with a preview of the upcoming XHTML2 and CSS3. Other topics include the newer initiatives in XHTML (XForms, XFrames, and modularization) and the essentials of XML for advanced readers.
You'll learn how to: Use style sheets to control your document's appearance Work with programmatically generated HTML Create tables, both simple and complex Use frames to coordinate sets of documents Design and build interactive forms anddynamic documents Insert images, sound files, video, applets, and JavaScript programs Create documents that look good on a variety of browsers The authors apply a natural learning approach that uses straightforward language and plenty of examples. Throughout the book, they offer suggestions for style and composition to help you decide how to best use HTML and XHTML to accomplish a variety of tasks. You'll learn what works and what doesn't, and what makes sense to those who view your web pages and what might be confusing. Written for anyone who wants to learn the language of the Web-from casual users to the full-time design professionals-this is the single most important book on HTML and XHTML you can own. Bill Kennedy is chief technical officer of MobileRobots, Inc.
Computer Science
When not hacking new HTML pages or writing about them, 'Dr. In biophysics from Loyola University of Chicago) is out promoting the company's line of mobile, autonomous robots that can be used for artificial intelligence, fuzzy logic research, and education. Chuck Musciano began his career as a compiler writer and crafter of tools at Harris Corporations' Advanced Technology Group and is now a manager of Unix Systems in Harris' Corporate Data Center. You might also like.