HTML Phrase Tags

Friday, 25 October 2013

HTML Phrase Tags

While some of these phrase elements are displayed in a similar manner to the ,
, 
, and  elements you have already seen, they are designed for specific
purposes. For example, the  and  elements give text emphasis and strong
emphasis respectively and there are several elements for marking up quotes.
We will see all phrase tags in this section with examples.

Emphasized Text – The Element:

The content of an  element is intended to be a point of emphasis in your
document, and it is usually displayed in italicized text. The kind of emphasis
intended is on words such as "must" in the following sentence:
You must remember to close elements in XHTML.
This will produce following result:
You must remember to close elements in XHTML.

Strong Text – The Element:

The  element is intended to show strong emphasis for its content; stronger
emphasis than the  element. As with the  element, the  element
should be used only when you want to add strong emphasis to part of a document.
You must remember to close elements in XHTML.
This will produce following result:
You must remember to close elements in XHTML.

Text Abbreviation – The Element :

You can indicate when you are using an abbreviated form by placing the abbreviation
between opening  and closing  tags.
I have a friend called Sam.
This will produce following result:
I have a friend called Sam.

Using Acronym – The Element :

The  element allows you to indicate that the text between an opening
 and closing  element is an acronym.
When possible use a title attribute whose value is the full version of the
acronyms on the  element, and if the acronym is in a different language,
include an xml:lang attribute in XHTML documents.
This chapter covers marking up text in XHTML.
This will produce following result:
This chapter covers marking up text in XHTML.
At present, the major browsers do not change the appearance of the content of the
 element.

Special Terms – The Element :

The  element allows you to specify that you are introducing a special term.
Its use is similar to the words that are in italics in the midst of paragraphs in
this book when new key concepts are introduced.
Typically, you would use the  element the first time you introduce a key term
and only in that instance. Most recent browsers render the content of a 
element in an italic font.
This tutorial teaches you how mark up your documents for the web using
XHTML.
This will produce following result:
This tutorial teaches you how mark up your documents for the web using XHTML.

Quoting Text – The
Element :

When you want to quote a passage from another source, you should use the
element.
Text inside a 
element is usually indented from the left and right edges of the surrounding text, and sometimes uses an italicized font.
The following description of XHTML is taken from the W3C Web
site:
XHTML 1.0 is the W3C's first Recommendation for XHTML, following on from earlier work on HTML 4.01, HTML 4.0, HTML 3.2 and HTML 2.0.
This will produce following result:
The following description of XHTML is taken from the W3C Web site:
XHTML 1.0 is the W3C's first Recommendation for XHTML,
following on from earlier work on HTML 4.01, HTML 4.0, HTML 3.2
and HTML 2.0.
You can use the cite attribute on the 
element to indicate the source of the quote.
The following description of XHTML is taken from the W3C Web
site:
XHTML 1.0 is the W3C' first Recommendation for XHTML, following on from earlier work on HTML 4.01, HTML 4.0, HTML 3.2 and HTML 2.0.

Short Quotations – The Element :

The  element is intended to be used when you want to add a quote within a
sentence rather than as an indented block on its own.
Amit is in Spain, 
He is their at my home. I think I am wrong.
This will produce following result:
Amit is in Spain, He is their at my home. I think I am wrong.
The  element can also carry the cite attribute. The value should be a URL
pointing to the source of the quote.

Citations – The Element :

If you are quoting a text, you can indicate the source placing it between an
opening  tag and closing  tag
As you would expect in a print publication, the content of the  element
is rendered in italicized text by default.
This HTML Tutorial is derived from World Wide Web Standard
for HTML.
This will produce following result:
This HTML Tutorial is derived from World Wide Web Standard for HTML.

Computer Code – The Element :

Any code to appear on a Web page should be placed inside a  element.
Usually the content of the  element is presented in a monospaced font,
just like the code in most programming books.

This is inside code element

This will produce following result:

This is inside code element

Keyboard Text – The Element :

When you are talking about computers, if you want to tell a reader to enter
some text, you can use the  element to indicate what should be typed in,
as in this example.
The content of a  element is usually represented in a monospaced font
rather like the content of the  element.

This is inside kbd element

This will produce following result:

This is inside kbd element

Programming Variables – The Element :

This element is usually used in conjunction with the 
 and 
elements to indicate that the content of that element is a variable
that can be supplied by a user.
document.write("user-name")
This will produce following result:
document.write("user-name")

Program Output – The Element :

The  element indicates sample output from a program, script, or
the like. Again, it is mainly used when documenting programming
concepts. For example:
Result produced by the program is Hello World
This will produce following result:
Result produced by the program is Hello World

Addresses – The
Element :

The 
element is used to contain any address. For example:
132, ABC Colony, XYZ - USA, 500032
This will produce following result:
132, ABC Colony, XYZ - USA, 500032


Block and Inline Elements:

We can categories all the elements into two sections:
Block-level elements - Block-level elements appear on the screen a if they
have a carriage return or line break before and after them. For example
the , 

,

,

,

,

,
,
    ,
      ,
      ,
      , 
      ,
      , and
      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.
      Inline elements - Inline elements, on the other hand, can appear within
      sentences and do not have to appear on a new line of their own. The , ,
      , , , , , , , 
      
    1. , , , , , , , and elements
    2. are all inline elements.
      The elements which we have not discussed till now, will be discussed in subsequent
      chapters.

No comments:

Post a Comment

 

Total Pageviews

Blogroll

Most Reading