How to create paragraphs?

 How to create paragraphs?


If you want to declare paragraphs on web pages you can use the <p> tag. Also, you can apply different types of formatting to paragraphs. See the following example:


<p>
    <b>Bold Text</b><br>
    <i>Text in italics</i><br>
    <u>Underlined text</u><br>
    <sub>Subscribed text</sub><br>
    <sup>Overwritten text</sup><br>
    <big>Text bigger than the default</big><br>
    <small>Text smaller than the default</small><br>
    <em>Text in italics</em><br>
    <strong>Bold Text</strong>
</p>


When displaying our code in a browser, we will see the following result:


We can also change the font using the style attribute and the font-family property:


<!-- Declaring a single font -->
<p style = "font-family: 'Times New Roman'">Hello world!</p>


<!-- Declaring two fonts -->
<p style="font-family:'Helvetica, Arial'">Hello world again!</p> 


Note that this part of the code:

<!-- Declaring a single font -->


... is not shown on the browser screen. Use the <!-- and --> symbols to enter comments. Comments allow you to organize the code.


Line Breaks

We can use the <br> tag to insert line breaks on your page.

Comments