Html Tags

3:39:00 PM |



The body
The body is where the meat of your document goes. It’s currently empty, but you’ll
be filling it with the content for your page soon enough.
<body> </body>
Lastly, you need to end the <html> element you opened back near the top of the
document: </html>
Marking up content
Now that you have the shell of your document in place, it’s time to start adding real content. There
are many elements at your disposal in XHTML, and all of them serve a different purpose.
 Let’s walk through some of the most important, starting with headlines.


As you start adding marked-up content to your XHTML document, pay close attention to the names
of the elements you use. Since the purpose of markup is to explicitly label the content to define what
kind of building block it is intended to be in the document, all the elements in XHTML are designed to
be semantically rich, or in other words, to provide meaning to the content they define.
Headlines
In almost any document you create, you’re going to come across the need for headlines to introduce
the sections of text or other content in the document. If you’ve dealt with any form of publishing in
the past, you’ll understand that there are different levels of headlines: primary, secondary, tertiary, and
so forth. In XHTML, you can use six levels of headlines, and the elements are called <h1>
to <h6>. The <h1> tag is for the most important headline in a document, and
<h2>, <h3>, and so on, decrease in importance until you get to <h6>, the least important (or most esoteric) headline in the  document.
Let’s take a look at an example:
<h1>How I Learned to Ride a Bike</h1>
Headlines, as you would expect, cannot be nested inside each other, but they can be
 right next to each other:
<h1>Overview of How I Learned to Ride a Bike</h1>
<h2>Step 1: Practice with Training Wheels</h2>
<h2>Step 2: Practice Balancing Without Support</h2>
In essence, headlines create an outline for your content, so when you mark up a
document with headlines, be sure to think about what kind of outline makes the
most sense.
Blocks of text
Most likely, a majority of your document will simply be blocks of text such as
paragraphs, block quotations,
and other such things. XHTML has elements specifically meant for each of these items. Most
are just as easy to apply as headlines. Let’s look at an example with a few paragraphs:
William Shakespeare was an English poet and playwright. He is widely
regarded as the greatest writer of the English language and the world's
pre-eminent dramatist. His surviving works include approximately
38 plays and 154 sonnets, as well as a variety of other poems.
Shakespeare was also respectively modest about his innovative works,
never truly boasting about his tremendous ability. He is often called
England's national poet and the "Bard of Avon" (or simply "The Bard").
Shakespeare was born and raised in Stratford-upon-Avon, and at age
eighteen married Anne Hathaway, with whom he had three children.
Sometime between 1585 and 1592 Shakespeare moved to London,
where he was an actor, writer, and part-owner of the playing company
the Lord Chamberlain's Men (later known as the King's Men), with which
he found financial success. Shakespeare appears to have retired to
Stratford in 1613, where he passed away three years later at the
age of 52.Shakespeare produced most of his known work between 1590
and 1612. He is one of the few playwrights of his time considered
to have excelled in both tragedy and comedy, and many of his dramas,
including Macbeth, Hamlet and King Lear, are ranked among
the greatest plays of Western literature. His works have greatly
influenced subsequent theatre and literature, through their
innovative use of plot, language, and genre
You specify to the web browser that these blocks of text are paragraphs by marking the
element designed for such content. Since paragraphs of text are such a common occurrence on
 web pages, the element for them is given the shorthand name <p>:



<p>William Shakespeare was an English poet and playwright. He is widely
regarded as the greatest writer of the English language and the world's
pre-eminent dramatist. His surviving works include approximately 38
plays and 154 sonnets, as well as a variety of other poems. Shakespeare
was also respectively modest about his innovative works, never truly
boasting about his tremendous ability. He is often called England's
national poet and the "Bard of Avon" (or simply "The Bard").</p>
<p>Shakespeare was born and raised in Stratford-upon-Avon, and at age
eighteen married Anne Hathaway, with whom he had three children.
Sometime between 1585 and 1592 Shakespeare moved to London,
where he was an actor, writer, and part-owner of the playing company
the Lord Chamberlain's Men (later known as the King's Men), with which
he found financial success. Shakespeare appears to have retired to
Stratford in 1613, where he passed away three years later at the age of
52.</p>
<p>Shakespeare produced most of his known work between 1590 and 1612.
He is one of the few playwrights of his time considered to have
excelled in both tragedy and comedy, and many of his dramas, including
Macbeth, Hamlet and King Lear, are ranked among the greatest plays of
Western literature. His works have greatly influenced subsequent
theatre and literature, through their innovative use of plot,
language, and genre.</p>






Again, there’s nothing complicated here. Simply start the paragraph with the open paragraph tag (<p>)
and end it with the close paragraph tag (</p>).
In addition to paragraphs, you can indicate that a selection of text is quoted from another source by
using the <blockquote> element (an abbreviation of block quotation). Since the only thing that the <blockquote> element indicates is that its content was sourced from somewhere  else, inside each <blockquote> element you will still need to use elements such as headlines and paragraphs to mark up the quotation’s content. It is by nesting elements in this way that you begin to provide rich meaning to your content. Here’s an example of a block quotation that
 quotes a couple of paragraphs:


<blockquote>
<p>Through the release of atomic energy, your generation has
brought into the world the most revolutionary force since
prehistoric man's discovery of fire. This basic force
of the universe cannot be fitted into the outmoded
concept of narrow nationalisms.</p>
<p>For there is no secret and there is no defense; there is no
possibility of control except through the aroused
understanding and insistence of the peoples of
the world. We scientists recognize your inescapable
responsibility to carry to your fellow citizens an
understanding of atomic energy and its implication
for society. In this lies your only security and your
only hope - you believe that an informed
citizenry will act for life and not for death.</p>
</blockquote>



1 comments:

Anonymous said...

Nice one