In-line elements

A number of HTML elements are in-line elements, meaning that they do not break the flow of text onto a new line (except in one case). These elements modify the style of the text or identify the nature of a range of significant characters.

The Tt (teletype) element specifies a monospaced font such as Courier. The B (bold) element specifies a bold typeface. The I (italic) element specifies an italic typeface:

<P>This paragraph contains <B>bold</B>,
					<I>italic</I> and <B><I>bold/italic</I></B> text.</P>

This paragraph contains bold, italic and bold/italic text.

Strong normally maps to bold typeface and Em (emphasis) to italic typeface. The computer sample elements Code and Var, as well as the Kbd (keyboard) element, normally map to a monospaced font. The Samp (sample) element and Cite (citation) element may both map to italic typeface:

<P><EM>Emphasized text</EM>.
					<STRONG>Strong text</STRONG>.
					<CODE>Computer text</CODE>.
					<KBD>Keyboard text</KBD>.
					<VAR>Variable text</VAR.
					<SAMP>Sample text</SAMP>.
					<CITE>Citation text</CITE>.</P>

Emphasized text. Strong text. Computer text.

Keyboard text. Variable text.

Sample text. Citation text.

The Dfn (defining instance) element encloses the first occurrence or most significant occurrence of a term used in the text. Potentially, this element may be used by search engines to determine keywords, and by style sheets to highlight new terms as they are introduced:

... Although <DFN>XML</DFN> is related
to <DFN>SGML</DFN>, XML is also related
to <DFN>HTML</DFN> as HTML is an application
of SGML.

The font size may be varied using the Font element (now deprecated). The Size attribute dictates the new font size, either absolutely, as a value between '1' and '7' (the default being '3'), or relatively as a size change from the current value. A relative size is given by inserting a '+' or '-' character:

This text is <FONT SIZE="-1">smaller</FONT> than
normal.

An additional Color attribute uses the scheme described above for changing the document colour in the Body element. Font elements can also be embedded within each other.

The deprecated Basefont element is used to specify a new default font size for the whole document and should therefore be placed at the top of the Body segment. It also uses a Size attribute to set the font size:

<BASEFONT SIZE="2">Text size is smaller than normal but
<FONT SIZE="+1">is now as expected</FONT>.

The Big and Small elements are complementary, and they specify larger and smaller text respectively, but the actual size is determined by the browser. The U (underline) element specifies a line under the enclosed text, and the Strike element specifies a line through the text (both elements are deprecated).

The Sub (subscript) and Sup (superscript) elements are complementary. The first encloses small text that appears below the baseline and the second encloses small text that appears above the baseline:

The W<SUP>3</SUP>C is responsible for HTML.
Water is H<SUB>2</SUB>O.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset