HTML Text Formatting. - Ashutosh

Hot

Post Top Ad

Thursday, September 21, 2017

HTML Text Formatting.

Hello, Everyone Myself Ashutosh . And today you learn about HTML Text formatting... Lets start...





HTML defines a lot of elements for         formatting output , Like bold or italic text. Beloware few examples that you can try out yourself :

Example : This Examples demonstartes how you can format text in an HTML documents.

<html>
<body>
<b> This text is bold</b>
<br>
<strong>
This text is strong
</strong>
<br>
<big>
This text is big
</big>
<br>
<em>
This text is emphasized
</em>
<br>

Output

    This text is bold
    This text is strong
    This text is big
    This text is emphasized


Example : This example demonstrates how you can control the line breaks and spaces with the pre tag.

<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>
<pre>
for i = 1 to 10
print i

next i
</pre>
</body>
</html>

Output

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

next i

Example : 
  
This example demonstrates how different "computer output" tags will be displayed.

<html>
<body>
<codes> 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 oftenused to display computer/programming code.
</p>
</body>
</html>

Output

 Computer code
 Keyboard input
 Teletype text
Sample text
Computer variable

Note:  This tags are often used to display computer/programming code.

Example : This example demonstartes how to write an address in an HTML document.

<html>
<body>
<address>
Donald duck<br>
BOX 555<br>
Disneyland<br>
USA
</address>
</body>
</html>


Output

Donald duck
BOX 555
Disneyland
USA


Example: This example demonstrates how to change the text direction.

<html>
<body>
<p>
If your browser supports bi-directional override (bdo). The next line will be written from the right to the left (rtl) :
</p>
<bdo dir ="rtl">
Here is some Hebrew text
</bdo>
</body>
</html>

Output

If your browser supports bi-directional override (bdo) , the next line will be written from the right to the left (rtl) :
Here is some hebrew text


Example : This example demonstrates how to mark a text that is deleted or inserted to a document.

<html>
<body>
<p>
a dozen is
<del>twenty</del>
<ins>twelve</ins>
pieces
</p>
<p>
Most browsers will overstrike deleted text and underline inserted text.

</p>
<p>
Some older browsers will display deleted or inserted text as plain text.
</p>
</body>
</html>

Output

A dozen is twelve pieces

Most browsers will overstrike deleted text and underline inserted text.

Some older browser will display deleted or inserted text as plain text.

                                      *****
Written With Heart 💙

Thanks.

Created by Ashutosh

Subscribe - Ashutosh000.blogspot.com