HTML TEXT FORMATTING TAGS


 

Defines how the content of the document is displayed in the browser. Classification

§  Text formatting elements also called as Font formatting

o   changes the font properties of the text (physical styles)

§  Block formatting tags

o   Usually applied to larger content than the text-level formatting tags. They define major sections of a document, such as paragraphs, headings, abstracts, chapters, and so on

§  Phrase Formatting elements also called as Quotation and Citation Elements

o   Describes how the text is being used in the context of the document

 

Text Formatting Tags

(All tags except <BASEFONT> are container tags)

TAG

Function

<B>

Contains text to be rendered in boldface

<I>

Contains text to be rendered in italic

<U>

Contains text to be rendered with an underline

<S> or <STRIKE>

Contains text to be marked with a strikethrough character

<BIG>

Contains text to be rendered in a font size bigger than the default font size

<SMALL>

Contains text to be rendered in a font size smaller than the default font size

<BASEFONT>

(Attributes – 3)

Sets base size, color, and typeface properties for the body text font. Deprecated in favor of using style sheets

<FONT>

(Attributes – 3)

Contains text whose font properties are to be modified

<SUB>

Contains text to be a subscript to the text that precedes it.

<SUP>

Contains text to be rendered as a superscript to the text that precedes it

<TT>

Contains text to be rendered in a fixed-width font.

 

 


 

Tag Attributes: <FONT> and <BASEFONT>

Attribute

Description and values

COLOR

Set to any of the 16 reserved, English-language color names or an RGB hexadecimal triplet. The default font color is black.

FACE

Set to a list of typefaces that the browser should use to render the text

SIZE

Set equal to an integer value between 1 and 7. This number is mapped to a font size in points by the browser, according to the user's preferences. The default SIZE value is 3.

 

Block Formatting Tags

Except <BR/> and <HR/> all are container tags

TAG

Function

<BLOCKQUOTE>

Contains quoted text that is to be displayed indented from regular body text

<BR>

Inserts a line break in the document.

<CENTER>

Centers all text and other page components it contains

<DIV>

Defines a section or division of a document that requires a special alignment

<HR>

Places a horizontal line on the page

<H1> – <H6>

Establishes a hierarchy of document heading levels. Level 1 has the largest font size. Increasing through the levels causes the font size to decrease. All headings are rendered in boldface and have a little extra line spacing built in above and below them

<P>

Denotes a paragraph

<PRE>

Denotes text to be treated as preformatted. Browsers render preformatted text in a fixed-width font. Whitespace characters, such as spaces, tabs and carriage returns found between the <PRE> and </PRE> tags are not ignored.

<SPAN>

Generic container tag for defining a document block. One popular use is for applying style information.

Tag Attributes: <BLOCKQUOTE>

Attribute

Description and values

CITE

Quotation source's URL.

 

Tag Attributes: <BR>

Attribute

Description and values

CLEAR

The CLEAR attribute tells which margin to break to when breaking beyond a floating page element, such as an image (Value: LEFT | RIGHT | ALL)

 

Tag Attributes: <DIV>, <H1> – <H6>, <P>

Attribute

Description and values

ALIGN

LEFT | RIGHT | CENTER | JUSTIFY

 

Tag Attributes: <HR>

Attribute

Description and values

ALIGN

LEFT | RIGHT | CENTER (Default)

NOSHADE

suppresses the shading effect and yields a solid line

SIZE

thickness of the line – Numeric value

WIDTH

Value set in pixels / %of browser screen

 

Phrase Formatting Tags

(All are container tags)

TAG

Function

<ABBR>

Contains text that is an abbreviation of preceeding text

Example: doctorate (<ABBR>PhD</ABBR>)

<ACRONYM>

Contains text that describes an acronym

<ADDRESS>

Contains either a postal or an electronic mail address, typically rendered in italic

<CITE>

Contains the name of a source from which a passage is cited and is rendered in italic

<STRONG>

Contains text to be strongly emphasized, rendered in boldface

<EM>

Contains text to be emphasized, rendered in italic.

<DFN>

Denotes the defining instance of a term

<DEL>

(Attributes – 2)

Contains text that has been deleted from the document

<INS>

(Attributes – 2)

Contains text that has been inserted into the document after its original draft

<KBD>

Contains text that represents keyboard input

<Q>

(Attributes – 1)

Contains a direct quotation to be displayed inline

<CODE>

Contains chunks of computer language code.

<SAMP>

Contains text that represents the literal output from a program

<VAR>

Denotes a variable from a computer program

 

 

Tag Attributes: <DEL> and <INS>

Attribute

Description and values

CITE

Provides the URL of a document that explains why the deletion was necessary

DATETIME

Puts a "timestamp" on the deletion

 

Tag Attributes: <Q>

Attribute

Description and values

CITE

URL of the quoted / cited document

 

 

 

No comments:

Post a Comment

Don't be a silent reader...
Leave your comments...

Anu