Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more ➡
Download
Standard view
Full view
of .
Add note
Save to My Library
Sync to mobile
Look up keyword
Like this
73Activity
×
0 of .
Results for:
No results containing your search query
P. 1
HTML -Complete Reference

HTML -Complete Reference

Ratings: (0)|Views: 4,664|Likes:
Published by api-19663878

More info:

Published by: api-19663878 on Nov 26, 2009
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See More
See less

03/18/2014

pdf

text

original

Introduction

The fourth edition of this book represents a significant change in order to fully embrace XHTML. Although the previous edition presented XHTML, most of the examples were still in HTML 4 with explanations about differences with XHTML. Today the situation is reversed with the primary focus on the future of markup with XHTML, CSS, and XML rather than the past, filled with tricks and messy table code.

Interestingly, while many books have embraced XHTML, relatively few Web page authors have. Furthermore, at the time of this edition's writing many Web tools do not produce correct markup in traditional HTML, let alone XHTML. Yet the times are changing. During 2002 and 2003 the survivors of the dot com boom have come to take their trade very seriously and more and more sites are truly embracing Web standards.

This book was updated assuming the "embrace the standards" trend will continue. HTML 4 is still well covered and the important table techniques are still presented, but compared to other books on HTML, heavy focus on what Netscape 2 did seven or more years ago is completely purged. Furthermore the focus is very much away from Netscape\u2014especially given that it has been recently discontinued\u2014and more on Internet Explorer, Mozilla, and Opera. Because of this focus on the future, the fourth edition should be both valuable to the standards-conscious designer looking for a reference as well as the newcomer hoping to learn what they need to know for today and tomorrow.

In closing, in my opinion any book that claims to be a "complete reference" has a pretty tough task to complete. But I do honestly believe that readers who study this book carefully will find that they have a complete understanding of HTML, XHTML, CSS, and related client-side technologies. However, if you master this one, remember as I rediscover every day\u2014there is always more to know about Web development. So if you master markup, there are plenty of other books (written both by me and by others) on JavaScript, Web Design, usability, and so on to keep you busy, so get cracking!

Part I: Introduction
Chapter List
Chapter 1: Introduction to HTML and XHTML
Chapter 2: Web Development Overview
Chapter 1: Introduction to
HTML and XHTML

Markup is information that is added to a document to convey information about the document's structure or presentation. Markup languages are all around us in everyday computing. While you may not see it, word processing documents are filled with codes indicating the structure and presentation of the document. What you see

on your screen just looks like a page of text, but the formatting is done "behind the scenes" by the markup. Hypertext Markup Language (HTML) and its successor, XHTML, are the not-so-behind-the-scenes markup languages that are used to tell Web browsers how to structure and, some may say, display Web pages.

First Look at HTML

In the case of HTML, markup commands applied to your Web-based content relay the structure of the document to the browser software and, though perhaps unfortunate at times, how you want the content to be displayed. For example, if you want to show that a section of text is important, you surround the corresponding text with the markup tags,<strong> and</strong>, as shown here:

<strong>This is important text!</strong>

When a Web browser reads a document that has HTML markup in it, it determines how to render the document onscreen by considering the HTML elements embedded within it (see Figure 1-1). Be aware that browsers don't always render things in the way that you think they will. This is due partially to the design of HTML and partially to the differences in the variety of Web browsers currently in use.

Figure 1-1: Interpretation of Web page with HTML markup

So we see that an HTML document is simply a text file that contains the information you want to publish and the appropriate markup instructions indicating how the browser should structure or present the document. These markup elements are made up of a start tag such as<strong>, and also might include an end tag, which is indicated by a slash within the tag such as</strong>. The tag pair should fully enclose any content to be affected by the element, including text and other HTML markup. However, under traditional HTML (not XHTML) some HTML elements have optional close tags because their closure can be inferred. Other HTML elements, called empty elements, do not enclose any content, and thus need no close tags at all, or in the case of XHTML, use a self-close identification scheme. For example, to insert a line break, use the<br> tag, which represents the emptybr element as it doesn't enclose any content and has no corresponding close tag.

<br>
An unclosed tag is not allowed in XHTML, however, so we need to close the tag like
so:
<br></br>
More often, we use a self-identification scheme of closure like so:

<br />The start tag of an HTML element might containat tributes that modify the meaning of the tag. The inclusion of thenoshade attribute in the <hr> tag, as shown here,

<hr noshade>

indicates that there should be no shading applied to the horizontal rule element. Under XHTML, such existence style attributes are not allowed. All attributes must have a value, so instead we use a syntax like the following:

<hr noshade="noshade" />

As the last example shows, attributes do require value and they are specified with an equal sign; these values should be enclosed within double or single quotes. For example,

<img src="logo.gif" alt="Demo Company" height="100" width="100" />

specifies four attributes for the <img> tag that are used to provide more information about the use of the included image. A complete overview of the structure of HTML elements is shown here:

Given these basic rules for HTML tags, it is best now to simply look at an example document to see how they are used. Our first complete example written in transitional HTML 4 is shown here:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>First HTML Example</title>
</head>
<body>
<h1>Welcome to the World of HTML</h1>
<hr>
<p>HTML <b>really</b> isn't so hard!</p>
<p>You can put in lots of text if you want to. In fact, you

Activity (73)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads
Aayush Bansal liked this
Aayush Bansal liked this
junaid liked this
m_ali21 liked this
bhuyanlalat liked this
saurabh liked this
hak2310 liked this
vspalanki liked this

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->