HTML Phrase Elements
Table of Content:
In the previous tutorial we saw some Presentational Elements
<b>
, <i>
, <pre>
, and <tt>
that you have just read about, but the following elements are not just for
presentational purposes; they also describe something about their content. For example, the words
written in an <em>
element will look just like the words in an <i>
element, but the < em> element is
supposed to indicate the addition of emphasis.
This section covers the following elements:
<em>
for emphasis<strong>
for emphasis< blockquote>
for quotations<cite>
for citations<q>
for quotations<abbr>
for abbreviations<acronym>
for acronyms<dfn>
for key terms<code>
for computer code and information<kbd>
Keyboard Text<var>
for Programming Variables<samp>
for Program Output<address>
for addresses
Emphasized Text
Anything that appears within <em>
...<em>
element is displayed as emphasized text.
Example
Emphasized Text Example The following word uses an emphasized typeface.
Live Preview
Strong Text: The <strong>
Element Adds Strong Emphasis
The <strong>
element is intended to show strong emphasis for its content — stronger emphasis than
the <em>
element.
Example
Strong Text Example The following word uses a strong typeface.
Live Preview
The <address>
Element Is for Addresses
The <address>
...</address>
element is used to contain any address.
Example
Address Example Biswa Bangla Sarani, Kolkata-136 - West Bengla
Live Preview
The <abbr>
Element Is for Abbreviations
Consider using a title
attribute whose value is the full version of the abbreviations. For
example, if you want to indicate that Bev is an abbreviation for Beverly, you can use the < abbr > element
like so:
Example
abbr Example APEC has how many member countries?
Live Preview
The <acronym>
Element Is for Acronym Use
The <acronym>
element allows you to indicate that the text
between <acronym>
and </acronym>
tags is an acronym.
At present, the major browsers do not change the appearance of the content of
the <acronym>
element.
Example
acronym Example This chapter covers marking up text in HTML .
Live Preview
<dfn>
Element Is for Special Terms
The <dfn>
element allows us to specify that we are introducing a special term.
Typically, you would use the <dfn>
element the first time you introduce a key term. Most recent browsers
render the content of a <dfn>
element in an italic font.
Example
Special Terms Example The following word is a special term.
Live Preview
The <blockquote>
Element Is for Quoting Text
When you want to quote a passage from another source, you should put it in between
<blockquote>
...</blockquote>
tags.
Example
Blockquote Example Quote:
I used to be a hopeless romantic - I fell in love with everyone I went out with.
Live Preview
<cite>
Attribute with the <blockquote>
Element
Example
Learn java Programming Language
Live Preview
The <q>
Element Is for Short Quotations
The <q>
...</q>
element is used when you want to add a double
quote within a sentence.
Example
Double Quote Example As Dylan Thomas said,
Somebody's boring me. I think it's me.
Live Preview
The <cite>
Element Is for Citations
The HTML <cite>
element defines the title of a work.
Browsers usually display <cite>
elements in italic.
If you are quoting a text, you can indicate the source by placing it between an opening </cite>
tag and
closing </cite>
tag. As you would expect in a print publication, the content of the </cite>
element is
rendered in italicized text by default
Example
Citations Example This HTML tutorial is derived from W3 Standard for HTML.
Live Preview
Computer Code
Note that when trying to display code on a web page (for example, if you were creating a page about web programming), and you wanted to include angled brackets, you cannot just use the opening and closing angle brackets inside these elements, because the browser could mistake these characters for actual markup. Instead you should use < ; instead of the left - angle bracket ( < ), and you should use > ; instead of the right - angle bracket ( > ).
The <code>
Element Is for Code
Any programming code to appear on a Web page should be placed inside <code>...</code>
tags. Usually the content of
the <code> element is presented in a monospaced font, just like the code in most programming books.
Example
Computer Code Example Regular text.
This is code.
Regular text.
<h1 >This is a primary heading </h1 >
Live Preview
The <kbd>
Element Is for Text Typed on a Keyboard
If, we are working with computers, we want to enter some text, we can use the <kbd>
element to indicate what should be typed in, as in this example
Example
Keyboard Text Example Regular text. This is inside kbd element Regular text.
To force quit an application in Windows, hold down the ctrl , alt and delete keys together.
The content of a <kbd>
element is usually represented in a monospaced font, rather like the content of
the <code>
element.
Live Preview
The <var>
Element Is for Programming Variables
The <var>
element is another of the elements added to help programmers.
This element is usually used in conjunction with the <pre>
and <code>
elements to indicate that the content of that element is a variable.
Example
Variable Text Example
document.write("user-name")
Live Preview
The <samp>
Element Is for a Program Output
The <samp>
...</samp>
element indicates sample output from a program, and script etc. Again,
it is mainly used when documenting programming or coding concepts.
Example
Program Output Example Result produced by the program is Hello World!