07. HTML Text Formatting

Text Formatting

<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><em>This text is emphasized</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>

Preformated Text (line breaks,spaces, and character width with the <pre> tag)

<html>
<body>
<pre>
This is preformatted text.
It preserves        both spaces
and line breaks and shows the text in a monospace font.
</pre>

<p>The pre tag is good for displaying computer code:</p>

<pre>
for i=1 to 10
print i
next i
</pre>
</body>
</html>

"Computer Output" Tags

<html>
<body>
<code>Computer code</code>
<br/>
<kbd>Keyboard input</kbd>
<br/>
<tt>Teletype text</tt>
<br/>
<samp>sample text</samp>
<br/>
<var>Computer variable</var>
<br/>

<p>
<b>Note:</b> These tags are often used to display computer/ programming code on the page.
</p>
</body>
</html>

Address

<html>
<body>
<address>
Donald Duck<br>
Box 555<br>
Disneyland<br>
USA
</address>
</body>
</html>

Abbreviations and Acronyms

<html>
<body>
<abbr title="United Nations">UN</abbr>
<br/>
<acronym title="world wide web">www</acronym>
<p>The title attribute is used to show the spelled-out version when holding the mouse pointer over the acronym or abbrevation.</p>
</body>
</html>

Text Direction

<html>
<body>
<p>
If your browser supports bidirectional override(bdo), the next line will be written from the right to the left(rtl):
</p>
<bdo dir="rtl">
Here is some backward text
</bdo>
<//body>
</html>

Quotations

<html>
<body>
A blockquotequotation:
<blockquote>
This is a long quotation. This is a long quotation. This is a long quotation. This is a long quotation. This is a long quotation.
</blockquote>
<p><b>The browser inserts line breaks and margins for a blockquote element.</b></p>
A short quotation:
<q>This is a short quotation</q>
<p><b>The q element does not render as anything special.</b></p>
</body>
</html>

Deleted and Inserted Text

<html>
<body>
<p>
a dozen is
<del>twenty</del>
<ins>twelve</ins>
pieces
</p>

<p>
Most browsers will <del>overstrike</del> deleted text and <ins> underscore</ins> inserted text.
</p>

<p>
some older browsers will display deleted or inserted text as plain text.
</p>

</body>
</html>

Text Formatting Tags

<b>
<big>
<em>        emphasized text
<i>
<small>
<strong>
<sub>
<sup>
<ins>
<del>
<s>            deprecated. use <del> instead
<strike>     deprecated. use <del> instead
<u>           deprecated. use style instead

Computer Output Tags

<code>       computer code text
<kbd>         keyboard text
<samp>       sample computer code
<tt>             teletype text
<var>        
<pre>
<listing>            deprecated. use <pre> instead
<plaintext>        deprecated. use <pre> instead
<xmp>              deprecated. use <pre> instead

Citations,Quotations and Definition Tags

<abbr>
<acronym>
<address>
<bdo>              text direction
<blockquote>   long quotation
<q>                  short quotation
<cite>               citation
<dfn>               definition term

No comments:

My Favorite Books

  • C and Data Structures by Ashok N. kamthane
  • Web Technologies by A. A. Puntambekar
  • Learn HTML and CSS with W3Schools
  • Learn JavaScript and Ajax with W3Schools
  • HTML5 Black Book: Covers Css3, Javascript,XML, XHTML, Ajax, PHP And Jquery
  • HTML5 Application Development Fundamentals: MTA Exam 98-375
  • .NET 4.0 Programming 6-In-1, Black Book
  • SQL Server 2008 R2 Black Book
  • Asp.net 4.0 Projects Covers: net 3.5 And .net 4.0 Codes, Black Book
  • UNIX Shell Programming 1 Edition by Yashavant Kanetkar
  • UNIX and Shell Programming 1 Edition by Richard F. Gilberg, Behrouz A. Forouzan
  • Computer Networks by Andrew S. Tanenbaum
  • Multiple Choice questions in computer science by Timothy J Williams