0% found this document useful (0 votes)
8 views18 pages

Formatting Characters

Format character in computer course

Uploaded by

Vincy Ram15
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views18 pages

Formatting Characters

Format character in computer course

Uploaded by

Vincy Ram15
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

Formatting characters

By
M.HEMAMALINI
⚫ In a web Page , the characters can be made
bold, italics, etc, by using some HTML tags.
⚫ There are two methods of formatting
characters.
⚫ They are
⚫ Logical styles
⚫ Physical styles
⚫ The logical styles inform the browser what
kind of text to present.
⚫ The browser takes care of how to present it .
⚫ For example consider <em> tag.
⚫ This tag says that emphasis must be given.
⚫ The browser takes care of how to present it
so that it gets the emphasis required.
Tag Meaning

<em>---- </em> Basic emphasis normally rendered in italics

<strong>----</strong Strong emphasis , normally rendered in bold style

<dfn>… </dfn> Defining instance of the enclosed term

<code>---</code> Extracts of program code

<samp>---</samp> Sample outputs from program, scripts etc

<kbd>---</kbd> Text to be typed by the user

<var> ---<var> Variables or arguments to commands

<cite>---</cite> Citation or reference to other sources


Physical style format

⚫ The physical style format tags explicitly


informs the browser how the characters must
be shown: bold, italics etc.
⚫ The physical style tags are shown.
Tag Meaning
<b>….</b> Bold face

<I>….</I> Italics

<tt>…</tt> Teletype or mono spaced font

<u>…</u> underline

<strike>…</strike> Strikethrough

<sub>…</sub> Subscript

<sup>…</sup> Superscript

<big>…</big> Larger font size

<small>…</small> Smaller font size


⚫ <html>
⚫ <head>
⚫ <title>
⚫ <physical Styles Format>
⚫ </title>
⚫ </head>

⚫ <body>
⚫ <br><b>St Xavier's College - Bold</b>
⚫ <br><i> St xavier's College - Italics</I>
⚫ <br><tt><St Xavier's College - teletype</tt>
⚫ <br><u> St Xavier's College - underline</u>
⚫ <br><strike> St Xavier's College - Strikethrough</strike>
⚫ <br> St Xavier's <sub> College </sub>
⚫ <br> St Xavier's <sup> College</sup>
⚫ <br><brg> St Xavier's College </big>
⚫ <br><small> St Xavier's College </small>
⚫ </body>
⚫ </html>
⚫ The <sub> and <sup> tags are used to
represent mathematical and chemical
formulae.

⚫ For example consider the formulae


⚫ Y = x2 + y2 +xasiny
⚫ This can be represented in html as follows
⚫ Y = x <sup>2</sup> + y <sup>2</sup> +
x<sup>asiny</sup>
<html>
<head>
<title>
<chemical equations>
</title>
</head>
<body>

<br>
<h1> Chemical equation </h1>
<hr>
<br>
<h2><i>
C<sub>2</sub>H<sub>5</sub>OH+PCL<sub>5</sub>=C<sub>2</sub>H<sub>5
</sub>CL+POCL<sub>3</sub>+HC.
<br>
4H<sub>3</sub>Po<sub>3</sub>=3H<sub>3</sub>PO<sub>4</sub>+PH<sub>3
</sub>
<br>
PCL<sub>3</sub>+CL<sub>=Pcl<sub>5</sub>
</i>
</h2>
</body>
Font tag

⚫ The <font> tag is used to set a specific font


and size.
⚫ It usually has two attributes namely face and
size.
⚫ For example consider the following
⚫ <font face = Arial size = 25>
⚫ Welcome Professor
⚫ </font>
⚫ This causes the message “welcome Professor” to appear in
Arial font with size = 25.
⚫ The size attribute of the <font> tag can be defined in one of two
ways.
⚫ They are absolute and relative sizes.

⚫ For example size = 25 is the absolute size.


⚫ This informs the browser that the text follows this tag must
appear in size 25.
⚫ In relative size, we inform the browser to increase or decrease
the usual size. Suppose we write
⚫ <font size = +3>
⚫ Departmental Activities
⚫ </font>
⚫ The heading “Departmental Activities” appears in the size which
is three more than the normal size . If the normal size is 12
points, this text will appear in 15 points.
Base font

⚫ At the beginning of the document , the default font


size for the entire page can be selected using the
<base font> tag , For example , consider the tag
shown below.
⚫ <base font = Arial size = 16>
⚫ This statement specifies Arial 16 points for the entire
document.
⚫ Notice that the <base font> tag has no
corresponding end tag as </base font>
Preformatting text

⚫ We can type the text without any change


using the <pre> </pre> tag pair.
⚫ The text or symbols between <pre> and
</pre> appear as they are in the page
Special characters

• Special characters such as <,>, etc can be


included in the web page using escape codes
which begin with the ampersand(&) symbol.
• The ampersand symbol must be followed by the
mnemonic keyword for the symbol.
• Some mnemonic symbols are shown in the
following table.
• Instead of mnemonic code, the ASCII code of
the symbol may also be given in the HTML code.
Mnemonic Symbol Description Decimal
Lt < Less than #60
Gt > Greater than #62
Amp & Ampersand #38
AEig Æ Capital AE diphthong #198
O slash Ø Capital oh slash #216
Quote ‘ Single Quote #62
© Cop yRight sign #169
± Plus or minus #177
1/4 Quarter #188
1/2 Half #189
3/4 Three-Quarters #190

You might also like