HTML provide many tags for formatting text. Formatting tags can be used to make a paragraph, text bold, text italic or in the list shape.
HTML Paragraph <p>
To make a paragraph in HTML <p> tag is used. The text for paragraph is enclosed in <p> and </p>. By using align attribute, we can align a paragraph to the left, right, or center.
<p>Creates a new paragraph </p>
<p align="right">Creates a new paragraph that will be aligned to right side</p>
HTML Line Break <br>
<br> inserts a line break. When we type our text in html, we may use many lines. But you will notice that the text will apear without any line break, that is it will ignore our new line and will display all text as once continuous paragraph. <br> is the solution of this problem.
If we insert <br> any where in our html, the contents after <br> will move to next line. <br> doesn't have a closing tag like head or body. Thats why br tag is close by using a forward slash inside the tag <br />, that means br start and ends in the same tag. There is no need to use an extra ending tag for br.
Example of HTML <br>
this is html br tag. it is for new line <br />
any thing after br tag will be on a new line <br>
oh br works in both ways with slash or without slash <br>
to keep our code standard we should use a slash with br <br />
HTML List
To make our text appear in a list shape we can use html list. HTML provides ordered and un ordered lists. Ordered lists are numbered while un ordered list are with bullets. The tag for ordered list is ol while for un ordered list ul can be used. We can use list item <li> to insert items in un ordered or ordered list
Example of HTML Ordered list
<ol>
<li>This is html list</li>
<li>It is an ordered list</li>
<li>for ordered list use ol tag</li>
<li>list items are represented by li</li>
<li>li stands for list item</li>
</ol>
- This is html list
- It is an ordered list
- for ordered list use ol tag
- list items are represented by li
- li stands for list item
Example of HTML Un Ordered list
<ul>
<li>This is html list</li>
<li>It is an un ordered list</li>
<li>for un ordered list use ul tag</li>
<li>list items are represented by li</li>
<li>li stands for list item</li>
</ul>
- This is html list
- It is an ordered list
- for ordered list use ol tag
- list items are represented by li
- li stands for list item