Friday, September 9, 2011

05 - HTML Formatting


HTML Formatting Tags

HTML uses tags like <b> and <i> for formatting output, like bold or italic text.

These HTML tags are called formatting tags.
Examples.



  Open Text Editor and type.
<html>
<body>

<p><b>This text is bold</b></p>

<p><strong>This text is strong</strong></p>

<p><big>This text is big</big></p>

<p><i>This text is italic</i></p>

<p><small>This text is small</small></p>

<p>This is<sub> subscript</sub> and <sup>superscript</sup></p>

</body>
</html>

Save the file as formatting.html
Open file in browser(internet explorer, firefox )

Output

This text is bold
This text is strong
This text is big
This text is italic
This text is small
This is subscript and superscript

<pre> Tag

<pre> tag gives us freedom to print ln brower in multiple line without using <br/> tag.

Example

Open Text Editor and type.

<html>
<body>
<pre>
This is
preformatted text.
It preserves      both spaces
and line breaks.
</pre>
<p>The pre tag is good for displaying computer code:</p>
for i = 1 to 10
     print i
next i
</body>
</html>


Save the file as pre_tag.html
Open file in browser(internet explorer, firefox )

Output
 

This is
preformatted text.
It preserves      both spaces
and line breaks.
The pre tag is good for displaying computer code:
for i = 1 to 10
     print i
next 


powered by multimediagyan ©

No comments:

Post a Comment