Showing posts with label Website Creation. Show all posts
Showing posts with label Website Creation. Show all posts

Assigning Meaning to XML Tags

2:10:00 PM |

Assigning Meaning to XML Tags


Markup tags can have three kinds of meaning: structure, semantics, and style. Structure divides documents into a tree of elements. Semantics relates the individual elements to the real world outside of the document itself. Style specifies how an element is displayed.
Structure merely expresses the form of the document, without regard for differences between individual tags and elements. For instance, the four XML documents shown below are structurally the same. They all specify documents with a single non-empty, root element. The different names of the tags have no structural significance.

<?xml version=”1.0” standalone=”yes”?>

<FOO>

Hello XML!
</FOO>
<?xml version=”1.0” standalone=”yes”?>
<GREETING>
Hello XML!
</GREETING>
 <?xml version=”1.0” standalone=”yes”?><P>
Hello XML!
</P>
 <?xml version=”1.0” standalone=”yes”?><DOCUMENT>
Hello XML!
</DOCUMENT>


Semantic meaning exists outside the document, in the mind of the author or reader or in some computer program that generates or reads these files. For instance, a Web browser that understands HTML(Hper Text Markup Language) but not XML(eXtensible Markup Language), would assign the meaning "paragraph" to the tags <p> and </p> but not to the tags <GREETING> and </GREETING>, <FOO> and </FOO>, or <DOCUMENT> and </DOCUMENT>. An English-speaking human would be more likely to understand <GREETING> and </GREETING> or <DOCUMENT> and </DOCUMENT> than <FOO> and </FOO> or <P> and </P>. Meaning, like beauty, is in the mind(or eye) of the beholder.
Computers, being relatively dumb machines, can't really be said to understand the meaning of anything. They simply process bits and bytes according to predetermined formula (albeit very quickly). A computer is just as happy to use <FOO> or <P> as it is to use the more meaningful <GREETING> or <DOCUMENT> tags. Even a Web browser can't be said to really understand that what a paragraph is. All the browser knows is that when a paragraph is encountered a blank line should be placed before the next element.
Natuarally, it's better to pick tags that more closely reflect the meaning of the information they contain. Many disciplines like math and chemistry are working on creating industry standard tag sets. These should be used when appropriate. However, most tags are made up as you need them.
Here are some o
Read More
6:09:00 PM |



Grouping Elements with <div> and <span>

The <div> and <span> elements allow you to group together several elements to create sections or subsections of a page. On their own, they will not affect the appearance of a page, but they are commonly used with CSS to allow you to attach a style to a section of a page. Forexample, you might want to put all of the footnotes on a page within a <div> element to indicate that all of the elements within that <div> element relate to the footnotes. You might then attach a style to this
<div> element so that they appear using a special set of style rules.
The <div> element is used to group block-level elements together:
<div class="footnotes"> <h2>Footnotes</h2> <p><b>1</b> The World Wide Web was invented by Tim Berners-Lee</p> <p><b>2</b> The W3C is the World Wide Web Consortium who maintain many Web
standards</p> </div>
The <span> element, on the other hand, can be used to group inline elements only. So, if you had a part of a sentence or paragraph you wanted to group together you could use the <span> element. Here you can see that I have added a <span> element to indicate which content refers to an inventor. It contains both a bold element and some text:
<div class="footnotes"> <h2>Footnotes</h2> <p><span class="inventor"><b>1</b> The World Wide Web was invented by Tim Berners Lee</span></p>

<p><b>2</b> The W3C is the World Wide Web Consortium who maintain many Web
standards</p>
</div>
On its own, this would have no effect at all on how the document looks visually, but it does add extra meaning to the markup, which now groups together the related elements. This grouping could either be used by a processing application, or could be used to attach special styles to these elements using CSS rules.
The <div> and <span> elements can carry all of the universal attributes and UI event attributes, as well as the deprecated align attribute (which is no longer available in Strict XHTML 1.0).

Read More
6:01:00 PM |


The <font> Element (deprecated)

You should be aware of the <font> element, which was introduced in HTML 3.2 to allow users more control over how text appears. It was deprecated in HTML 4.0, and has since been removed from XHTML. In its short life, however, it got a lot of use, and if you look at other people’s code you will see it
used a lot. If you want to read more about the <font> element, it is covered in Chapter 8. You might see the <font> element used like so: <h3>Using the &lt;font&gt; element</h3>
<font face="arial, verdana, sans-serif" size="2" color="#666666">The &lt;font&gt; element has been deprecated since HTML 4.0. You should now use CSS to indicate how text should be styled. </font>

Understanding Block and Inline Elements

Now that you have seen many of the elements that can be used to mark up text, it is important to make an
observation about all of these elements that live inside the <body> element because each one can fall into
one of two categories:
. Block-level elements
. Inline elements
This is quite a conceptual distinction, but it will have important ramifications for other features of
XHTML (some of which you are about to meet).
Block-level elements appear on the screen as if they have a carriage return or line break before and after
them. For example the <p>, <h1>, <h2>, <h3>, <h4>, <h5>, <h6>, <ul>, <ol>, <dl>, <pre>, <hr />,
<blockquote>, and <address> elements are all block level elements. They all start on their own new line, and anything that follows them appears on its own new line, too.
Inline elements, on the other hand, can appear within sentences and do not have to appear on a new line of their own. The <b>, <i>, <u>, <em>, <strong>, <sup>, <sub>, <big>, <small>, <li>, <ins>, <del>, <code>, <cite>, <dfn>, <kbd>, and <var> elements are all inline elements.
For example, look at the following heading and paragraph. These elements start on their own new line and anything that follows them goes on a new line, too. Meanwhile the inline elements in the paragraph
do not require their own new line. Here is the code (ch02_eg20.html):
<h1>Block-Level Elements</h1>
<p><strong>Block-level elements</strong> always start on a new line. The
<code>&lt;h1&gt;</code> and <code>&lt;p&gt;</code> elements will not sit
on the same line, whereas the inline elements flow with the rest of the
text.</p>

You should also be aware that in Strict XHTML block-level elements can contain other block-level elements, and inline elements. However, inline elements can appear only within block-level elements, and they may not contain block-level elements (so you should not have a <b> element outside of a block-level element).




© ScienceZen All rights Reserved
Read More

HTML : Comments

5:53:00 PM | ,



Comments

You can put comments between any tags in your XHTML documents. Comments use the following syntax:
<!-- comment goes here -->
Anything after <!-- until the closing --> will not be displayed. It can still be seen in the source code for the document, but it is not shown onscreen.
It is good practice to comment your code, especially in complex documents, to indicate sections of a document, and any other notes to anyone looking at the code. Comments help you and others understand your code.
You can even comment out whole sections of code. For example, in the following snippet of code you would not see the content of the <h3> element. You can also see there are comments indicating the section of the document, who added it, and when it was added.

<!-- Start of Footnotes Section added 04-24-04 by Bob Stewart -->
<!-- <h2>Character Entities</h2> -->
<p><strong>Character entities</strong> can be used to escape special
characters that the browser might otherwise think have special meaning.</p>
<!-- End of Footnotes section -->

Read More

Using Character Entities for Special Characters

5:47:00 PM | ,


Using Character Entities for Special Characters

You can use most alphanumeric characters in your document and they will be displayed without a problem. There are, however, some characters that have special meaning in XHTML, and for some characters there is not an equivalent on the keyboard you can enter. For example, you cannot use the angle brackets that start and end tags, as the browser can mistake the following letters for markup. You can, however, use a set of different characters known as a character entity to represent these special characters. Sometimes you will also see character entities referred to as escape characters.
All special characters can be added into a document using the numeric entity for that character, and some also have named entities, as you can see in the table that follows.

Character        Numeric Entity                                Named Entity
”                            &#034;                                                     &quot;
&                          &#038;                                                       &amp;
<                         &#060;                                                         &lt;
>                         &#062;                                                          &gt;





Read More

Using to Indicate Deleted Text

5:35:00 PM | ,




If you want to delete some text from a document, you can place it inside a <del> element to indicate that it is marked to be deleted. Text inside a <del> element will have a line or strikethrough .
<del><p>This paragraph is contained inside a &lt;del&gt; element.</p></del>

The <del> element can carry the cite, datetime, and title attributes just like the <ins> element.
When you learn how to use CSS, you will see how it would be possible to show and hide the inserted and deleted content as required.




© ScienceZen 2012 All Rights Reserved
Read More

Web Programming : Core Attributes : The style Attribute (Deprecated)

5:28:00 AM |




The style Attribute (deprecated)
The style attribute allows you to specify CSS rules within the element. For example:
<p style="font-family:arial; color:#FF0000;">Some text...</p>
As a general rule, however, it is best to avoid the use of this attribute. After all, one of the aims of XHTML was to remove stylistic markup from structural and semantic markup . This
attribute is marked as deprecated in XHTML 1.0 (which means it will be removed from future versions of XHTML). If you want to use CSS( Cascading Style Sheet - We will talk about this later) rules to govern how an element appears, it is better to use the class attribute to associate the element with a CSS rule either in the <style> element or a separate style sheet instead. 
Read More

Today is Alan Turing''s 100th birthday

2:29:00 PM | ,

Today is Alan Turing's 100th anniversary, the father of computer science. In favor of that, Google has created an animation of one of his works on the Google Search page.
Read More

Web Programming : Core Attributes : The Class Attribute

9:42:00 AM |


class


The class Attribute
The class attribute is used to associate an element with a style sheet, and specifies the class of element.
(You will learn more about this in our later articles, which introduces CSS.) The syntax of
the class attribute is as follows:
class="className"
The value of the attribute may also be a space-separated list of class names. For example:
class="className1 className2 className3"
Read More

Web Programming : Core Attributes : The Title Attribute

9:28:00 AM |



The title Attribute
The title attribute gives a suggested title for the element. They syntax for the title attribute is as
follows:
title="string"
The behavior of this attribute will depend upon the element that carries it, although it is often displayed
as a tooltip or while the element is loading.
Not every element that can carry a title attribute really needs one, so I will explain when this attribute
is of particular use and will show you the behavior it has when used with that element.

Read More

WEB PROGRAMMING: CORE ATTRIBUTES : THE id ATTRIBUITE

8:22:00 AM |




THE ID ATTRIBUTE
The id attribute can be used to uniquely identify any element within a page or style sheet. There are two
primary reasons that you might want to use an id attribute on an element:
❑ If an element carries an id attribute as a unique identifier it is possible to identify just that element and its content (perhaps you want to link to a specific point in a document, to select one specific element’s content, to associate a CSS style with a particular element, or identify that element using a script).
❑ If you have two elements of the same name within aWeb page or style sheet, you can use the id  attribute to distinguish between elements that have the same name (this is very likely, when you think most pages will contain at least two or more paragraphs of text).
The syntax for the id attribute is as follows (where string is your chosen value for the attribute):
id="string"
For example, the id attribute could be used to distinguish between two paragraph elements, like so:
<p id="accounts">This paragraph explains the role of the accounts
department.</p>
<p id="sales">This paragraph explains the role of the sales
department.</p>
Note that there are some special rules for the value of the id attribute; it must:
❑ Begin with a letter (A–Z or a–z) and can then be followed by any number of letters, digits (0–9),
hyphens, underscores, colons, and periods (you may not start the value with a digit, hyphen, underscore, colon, or period).
❑ Remain unique within that document; no two attributes may have the same value within that XHTML document. Before the id attribute was introduced, the name attribute served a similar purpose in HTML documents, but its use was deprecated in HTML 4.01, and now you should generally use the id attribute in XHTML
documents. If you need to use the name attribute it is available in Transitional XHTML, but not Strict XHTML
Read More

Web Programming : Core Attributes

7:03:00 AM | , , ,




CORE ATTRIBUTES
The four core attributes that can be used on the majority of XHTML elements (although not all) are:


  • id title class style


Where these attributes occasionally have special meaning for an element that differs from the description
given here they will be visited again; otherwise their use can generally be described as you see in the
subsections that follow.
Read More

Website Programming : Attribute Groups

6:48:00 AM |




Attribute Groups
As you saw in one of our previous articles, attributes live on the opening tag of an element and provide extra information about the element that carries them. All attributes consist of a name and a value; the name reflects a property of the element the attribute is describing and the value is a value for that property. For example,
the xml:lang attribute describes the language used within that element; a value such as EN-US would indicate that the language used inside the element is U.S. English. Many of the elements in XHTML can
carry some or all of the attributes you will meet in this section.
There are three groups of attributes that many of the XHTML elements can carry (as you have already seen, the <html>, <head>, <title>, and <body> elements share some of these attributes). Because
these attributes are common to so many of the elements, they are grouped together here to avoid having to repeat them each time they come up, so remember where you read this and you can keep referring
back to them. The groups are:
❑ Core attributes: The class, id, and title attributes.
❑ Internationalization attributes: The dir, lang, and xml:lang attributes.
❑ UI events: Attributes associated with events onclick, ondoubleclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, and onkeyup Together the core attributes and the internationalization attributes are known as the universal attributes.
Read More

Web Progamming : The Body Element

5:59:00 AM |




The <body> Element
The <body> element appears after the <head> element and contains the part of the Web page that you actually see in the main browser window, which is sometimes referred to as body content. It may contain anything from a couple of paragraphs under a heading to more complicated layouts containing forms and tables, and is likely to constitute the majority of any XHTML(eXtensible HyperText Markup Language) document. Most of what you will be
learning in this and the following five chapters will be written between the opening <body> tag and closing </body> tag.


The <body> Element
The <body> element appears after the <head> element and contains the part of the Web page that you actually see in the main browser window, which is sometimes referred to as body content. It may contain
anything from a couple of paragraphs under a heading to more complicated layouts containing forms and tables, and is likely to constitute the majority of any XHTML document. Most of what you will be learning in this and the following five chapters will be written between the opening <body> tag and closing </body> tag.


The <body> element may carry all of the attributes from the attribute groups you are about to meet in the next section. If you are using Transitional XHTML or HTML 4.1, you can use any of the following deprecated attributes on the <body> element (which will be covered later in our coming articles): background bgcolor alink link vlink text
There are also several browser specific attributes that you might see used on the <body> element; these also are later.
language, topmargin, bottommargin, leftmargin, rightmargin, scroll, bgproperties, marginheight, marginwidth





Read More

Web Programming : The Title Element

5:44:00 AM |



The <title> Element
You should specify a title for every page that you write inside the <title> element (which is a child of
the <head> element). It is used in several ways:
. At the very top of a browser window (as shown in Figure 2-1)
. As the default name for a bookmark in browsers such as IE and Netscape
. By search engines that use its content to help index pages
Therefore it is important to use a title that really describes the content of your site. For example, if you
have a “contact us” page in your site, do not just use Contact Us for the title. Include your company or
site name. Something like this would be more appropriate:
<title>ScienceZen : Contact Details</title>
Where possible, your title should describe the content of that page; for example, your home page should
not just say “Home page.” It should say what your site is about. For example:
<title>ScienceZen Music: Vintage Guitars, Keyboards, and Drums</title>
Figure 2-1


The test for a good title is whether a visitor can tell what she will find on that page just by reading the
title, without looking at the actual content of the page.
The <title> element should contain only the text for the title; it may not contain any other elements.
For example, you cannot add any instructions as to how the title should be formatted. Figure 2-1 shows
how the content of the <title> element is displayed in the browser window and in the favorites in IE.


The <title> element can carry the following attributes, which are covered in the “Attribute Groups”
section later :
id dir lang xml:lang



Read More

Web Programming : The Head Element

5:21:00 AM |





The <head> Element
The <head> element is just a container for all other header elements. It should be the first thing to appear
after the opening <html> tag.
Each <head> element should contain a <title> element indicating the title of the document, although it
may also contain any combination of the following elements, in any order:


  • <base>, which you will meet later in the coming articles..
  • <object>, which is designed to include images, JavaScript objects, Flash animations, MP3 files,
  • QuickTime movies and other components of a page. (It will be covered in the coming articles)
  • <link> to link to an external file, such as a style sheet or JavaScript file, as you will see later in our articles.
  • <style> to include CSS rules inside the document
  • <script> for including script in the document
  • <meta>, which includes information about the document such as keywords and a description,


which are particularly helpful for search applications
The opening <head> tag can carry the following attributes:
id dir lang xml:lang profile
The profile attribute is not actually in use yet, although it was included so it could be used in the future
to specify a URL for something known as a profile that would describe the content of the document. The
other attributes are covered in the “Attribute Groups” in our later articles.
Read More

Web Programming : Understanding the Basic Document Structure

3:32:00 AM |




Understanding the Basic Document Structure
As you saw in the previous article, XHTML documents are contained between the opening <html> and closing
</html> tags (this <html> element is also known as the root element). Inside these tags, the document is
split into two sections:
. The <head> element, which contains information about the document (such as a title or a link to a
style sheet)
. The <body> element, which contains the real content of the document that you see.
This section takes a closer look at the four main elements that form the basic structure of every document:
<html>, <head>, <title>, and <body>. These four elements should appear in every XHTML
document that you write, and you will see them referred to throughout this book as the skeleton of the
document.
Remember that before an opening <html> tag, an XHTML document can contain the optional XML
declaration, and it should always contain a DOCTYPE declaration indicating which version of XHTML ituses.
The <html> Element
The <html> element is the containing element for the whole HTML or XHTML document. After the
optional XML declaration and required DOCTYPE declaration, each XHTML document should have an
opening <html> tag and each document should end with a closing </html> tag.
If you are writing Strict XHTML 1.0, the opening tag must also include something known as a namespace
identifier (this indicates that the markup in the document belongs to the XHTML 1.0 namespace).
Therefore the opening tag should look like this:
<html xmlns="http://www.w3.org/1999/xhtml">
While it is not strictly required in Transitional XHTML documents, it is a good practice to use it on all
XHTML documents.
Only two elements appear as direct children of an <html> element: <head> and <body> (although the
<head> and <body> elements will usually contain many more elements).
Read More

Creating Professional Webpages

10:06:00 AM |



Separating Heads from Bodies
Whenever you write a Web page in HTML, the whole of the page is contained between the opening
<html> and closing </html> tags, just as it was in the last example. Inside the <html> element, there
are two main parts to the page:
❑ The <head> element: Often referred to as the head of the page, this contains information about
the page (this is not the main content of the page). It is information such as a title and a
description of the page, or keywords that search engines can use to index the page. It consists of
the opening <head> tag, the closing </head> tag, and everything in between.
❑ The <body> element: Often referred to as the body of the page, this contains the information
you actually see in the main browser window. It consists of the opening <body> tag, closing
</body> tag, and everything in between.
Inside the <head> element of the first example page you can see a <title> element:
<head>
<title>Acme Toy Company: About Us</title>
</head>
Between the opening and closing title tags are the words Acme Toy Company: About Us, which is the
title of this Web page. If you remember Figure 1-2, which showed the screenshot of this page, I brought
your attention to the words right at the top of the browser in the center. This is where Internet Explorer
(IE) displays the title of a document; it is also the name IE uses when you save a page in your favorites.
The real content of your page is held in the <body> element, which is what you want users to read, and is
shown in the main browser window.
The head element contains information about the document, which is not displayed
within the main page itself. The body element holds the actual content of the page
that is viewed in your browser.
Adding Style
The first example page isn’t going to win any awards for design. Indeed, when theWeb started it was a
rather gray place filled with drab pages like this one. While the Web was originally conceived to transmit
scientific research documents (so that existing research could reach wider audiences), it did not take long
for people to find other uses for it. No one can question that the speed with which the Web has grown is
phenomenal, and it did not take long for people to start creatingWeb pages for all different kinds of
purposes—from individuals setting up homepages about their family or hobbies to big corporations
setting up vast sites that highlighted their products and services.


As the Web grew, people who were building these pages wanted more control over how their pages
appeared. In order for this to happen, the W3C (which stands for WorldWide Web Consortium, the body
responsible for creating the HTML specifications), and the people writing theWeb browsers (in particular
Netscape and Microsoft) introduced new markup. Soon there was markup allowing you to specify
different fonts, colors, backgrounds, and so on. It was in catering to these new requirements of the Web
that new versions of HTML were spawned.
Consider the possibilities: You could take the first briefWeb page from earlier in the chapter, specify the
typeface (or font) you want the page to use, change the color of the text in the main paragraph to red, and
indicate that some of the text should be in a bold or italic font. The whole of the page could also have a
very light gray background, in which case it would look something like Figure 1-4.



Read More

Web Creation : Learning HTML Tags

9:12:00 AM |



Tags and Elements
If you look at the first and last lines of the code for the last example, you will see pairs of angle brackets
containing the letters <html>. The two brackets and all of the characters between them are known as a
tag, and there are lots of tags in the example. All of the tags in this example come in pairs; there are
opening tags and closing tags. The closing tag is always slightly different than the opening tag in that it has
a forward slash character before the characters </html>.
A pair of tags and the content it includes is known as an element. In Figure 1-3 you can see the heading for
the page of the last example.
Figure 1-3


Again, the tags in Figure 1-3 come in pairs. I mentioned earlier in the chapter that markup adds meaning
to a document, and in HTML it is the tags that are the markup. The special meaning these tags give is a
description of the structure of the document. The opening tag says “This is the beginning of a heading”
and the closing tag says “This is the end of a heading.”Without the markup, the words in the middle
would just be another bit of text; it would not be clear that they formed the heading.
Now look at the paragraph of text about the company; it is held between an opening <p> tag and a
closing </p> tag. And, you guessed it, the p stands for paragraph.
Because this basic concept is so important to understand, I think it bears repeating:
tags are the letters and numbers between the angle brackets, whereas elements are
tags and anything between the opening and closing tags.
As you can see, the markup in this example actually describes what you will find between the tags, and
the added meaning the tags give is describing the structure of the document. For example, between the
opening <p> and closing </p> tags are paragraphs and between the <h1> and </h1> tags is a heading.
Indeed, the whole HTML document is contained between opening <html> and closing </html> tags.

If you were wondering why there is a number 1 after the h , it is because in HTML and XHTML there are
six levels of headings. A level 1 heading is sometimes used as the main heading for a document (such as a
chapter title), which can then contain subheadings, with level 6 being the smallest. This allows you to
structure your document appropriately with subheadings under the main heading. (You look at this in
detail in the next chapter.)

You will often find that terms from a family tree are used to describe the relationships between elements.
For example, an element that contains another element is known as the parent, while the element that is
between the parent element’s opening and closing tags is called a child of that element. So, the <title>
element is a child of the <head> element, the <head> element is the parent of the <title> element, and
so on. Furthermore, the <title> element can be thought of as a grandchild of the <html> element.

Separating Heads from Bodies
Whenever you write a Web page in HTML, the whole of the page is contained between the opening
<html> and closing </html> tags, just as it was in the last example. Inside the <html> element, there
are two main parts to the page:
❑ The <head> element: Often referred to as the head of the page, this contains information about
the page (this is not the main content of the page). It is information such as a title and a
description of the page, or keywords that search engines can use to index the page. It consists of
the opening <head> tag, the closing </head> tag, and everything in between.
❑ The <body> element: Often referred to as the body of the page, this contains the information
you actually see in the main browser window. It consists of the opening <body> tag, closing
</body> tag, and everything in between.
Inside the <head> element of the first example page you can see a <title> element:
<head>
<title>Acme Toy Company: About Us</title>
</head>
Between the opening and closing title tags are the words Acme Toy Company: About Us, which is the
title of this Web page. If you remember Figure 1-2, which showed the screenshot of this page, I brought
your attention to the words right at the top of the browser in the center. This is where Internet Explorer
(IE) displays the title of a document; it is also the name IE uses when you save a page in your favorites.
The real content of your page is held in the <body> element, which is what you want users to read, and is
shown in the main browser window.
The head element contains information about the document, which is not displayed
within the main page itself. The body element holds the actual content of the page
that is viewed in your browser.





Read More

Web Creation : Introducing Web Technologies

6:46:00 AM |




Introducing Web Technologies
Now that you are thinking of the Web as a huge collection of documents, not dissimilar to the documents
you come across in everyday life, and you know how aWeb page gets to you when you type a URL into
your browser, it is time to look at the technologies used to writeWeb pages.
In this section you meet HTML, CSS, XHTML, and JavaScript. You will get an idea what each language is
used for and start to see the basics of how each works.With a basic understanding of each of these
technologies you will find it easier to see the big picture of creating pages for the Web.
Introducing HTML
HTML, or Hypertext Markup Language, is the most widely used language onWeb. As its name suggests,
HTML is a markup language, which may sound complicated, although really you come across markup
every day. Markup is just something you add to a document to give it special meaning; for example,
when you use a highlighter pen you are marking up a document. When you are marking up a document
for the Web, the special meaning you are adding indicates the structure of the document, and the markup
indicates which part of the document is a heading, which parts are paragraphs, what belongs in a table,
and so on. This markup in turn allows a Web browser to display your document appropriately.
When creating a document in a word processor, you can distinguish headings using a heading style
(usually with a larger font) to indicate which part of the text is a heading. You can use the Enter

(or Return) key to start a new paragraph. You can insert tables into your document, create bulleted lists,
and so on. When marking documents up for the Web you are performing a very similar process.
HTML and XHTML are the languages you use to tell aWeb browser where the heading is for aWeb page,
what is a paragraph, what is part of a table and so on, so it can structure your document and render it
properly. But what is the difference between HTML and XHTML?Well, first you should know that there
are several versions of both HTML and XHTML, but don’t let that bother you—it all sounds a lot more
complicated than it really is. Whereas there are several versions of HTML, each version just adds
functionality on top of its predecessor (like a new version of some software might add some features or a
new version of a dictionary might add a few extra words), or offers better ways of doing things that were
already in earlier versions. So, you do not need to learn each version of HTML and XHTML, nor do you
need to focus on one variation. This book teaches you all you need to know to writeWeb pages using
HTML and XHTML. Indeed, as I mentioned in the Introduction, XHTML is just like the latest version
of HTML, as you will see shortly (although to be accurate, while it is almost identical to the last version of
HTML, it is technically HTML’s successor).
Let’s have a look at a simple page in HTML.

<html>
<head>
<title>Acme Toy Company: About Us</title>
</head>
<body>
<h1>About Acme Toys Inc.</h1>
<p>Acme Toys has been making toys for popular cartoon characters for
over 50 years. One of our most popular customers was Wile E. Coyote, who
regularly purchased items to help him catch Road Runner.</p>
</body>
</html>

This may look a bit confusing at first, but it will all make sense soon. As you can see, there are several sets
of angle brackets with words or letters between them such as <html>, <head>, </title> and
</body>. These words in the angle brackets are known as markup. Figure 1-2 illustrates what this page
would look like in a Web browser
Figure 1-2

As you can see, this document contains the heading “About ACME Toys Inc.” and a paragraph of text to
introduce the fictional company. Note also that it says “Acme Toy Company: About Us” right at the top of
the window in the middle; this is known as the title of the page.
To understand the markup in this first example, you need to look at what is written between the angle
brackets and compare that with what you see in the figure, which is what you will do next.




Read More