HTML Text is written using tags. By default, the text written in body is called plain text. All text elements are written inside body.
<p> is the common tag use to write paragraphs. There are six headings in html,
h1-h6. Here is a list of popular HTML Text tags with example.
By default the plain text is black in color and with transparent background. To change color and backgrounds, we need to use CSS.
Any text written in directly inside body ( without any tag ) is known as Plain text in html. Plain Text always starts in same line and supports single white space. The default font size is 16px.
Plain Text Plain Text
<!doctype html> <html lang="en"> <head> <title>Hello HTML</title> <meta charset="UTF-8"> </head> <body> Plain Text Plain Text </body> </html>
Paragraph Tag or p tag is most commonly used tag to write a paragraph in HTML. By default p tag is Block level and occupy 1 em font size. P tag always start and ends with a new line. Default width of p tag is 100% of parent element.
Align attribute is removed in HTML5. To align text in Html5, use CSS text align.
This is a Paragraph
This is a Paragraph
<p>This is a Paragraph</p> <p>This is a Paragraph</p>
Address tag is used to add postal address in a webpage. Address is function element, and italic in style. Default font-size is 1em.
3rd Floor, OM Complex,
Sec 15, Noida UP, 201301
Ph: (0120) 4280181
<address> Tech Altum <br> 3rd Floor, OM Complex, <br> Sec 15, Noida UP, 201301<br> <abbr title="Phone No">Ph</abbr> (0120) 4280181 </address>
Blockquote tag is used to write a Block Level quotation with extended quotation in HTML. This is mainly a text with Extended Quotation. By-default there is a margin of 40px from left and right in blockquote.
This is blockquote Tag.
<blockquote> blockquote Tag </blockquote>
All HTML Textual Tags ignore white space and line break. Means text is not formatted.
PRE Tag is the only tag which follow the exact format in which you are writing.
PRE Tag with white spacing more than one
PRE Tag with line break
<pre> PRE Tag </pre> <pre> PRE Tag with white spacing more than one </pre> <pre> PRE Tag with line break </pre>
TT( Tele Type) Tag was an inline element with default monospace font. In HTML5, we can use css font-family property to do same.
(Removed in HTML5)
<tt> TT Tag </tt>
Font Tag was used to add color, font-family and size to the text inside font tag. But in HTML5, we use css to change style of text.
(Depreciated in HTML5)
Default FONT Tag
Font Tag with color red
Font Tag with cursive face
Font Tag with size 1
Font Tag with size 7
Font Tag with size 3 and face "Times New Roman".
Font Tag with size 4 and face "Verdana".
Font Tag with size 5 and face "Comic Sans MS".
Font Tag with size 6, face Algerian and color blue.
<font> Default FONT Tag ;/font> <font color="red"> Font Tag with color red </font> <font face="cursive"> Font Tag with cursive face </font> <font size="1"> Font Tag with size 1 </font> <font size="7"> Font Tag with size 7 </font> <font size="3" face="Times New Roman"> Font Tag with size 3 and face "Times New Roman". </font> <font size="4" face="Verdana"> Font Tag with size 4 and face "Verdana". </font> <font size="5" face="Comic sans MS"> Font Tag with size 5 and face "Comic san MS". </font> <font face="algerian" size="6" color="blue"> Font Tag with size 6, face Algerian and color blue. </font>
Font and tt tag are deleted in HTML5.