Topic 2 : HTML Elements

What is Elements?

An element in HTML is a building block of a webpage. It usually has a start tag, some content, and an end tag.

HTML ELEMENTS?

We are going to learn paragraph <p></p>, bold<b></b>, heading tags (<h1></h1> to <h6></h6>) 

1) Paragraph Tag

<p>This is Paragraph </p> 

<p>This is Paragraph<p><b>I am nested Tag</b> </p> 

Output: This is Paragraph I am nested Tag

"Note: In HTML, extra spaces within a paragraph are ignored. Even if you add multiple spaces, HTML will display only a single space between words."

HTML ignores extra spaces by default, but you can use &nbsp; , <pre>, or white-space: pre; to keep them visible.

Examples to keep spaces visible:

<p>Hello&nbsp;&nbsp;&nbsp;World!</p>

<pre>
This is a paragraph.
</pre>

<p style=”white-space: pre;”>This is a paragraph.</p>

2) Bold Tag

<b>I am Bold </b> 

Output :I am Bold

3) Heading Tag

<h1>This is  Heading 1 </h1> 

<h2>This is  Heading 2 </h2> 

<h3>This is  Heading 3 </h3> 

<h4>This is  Heading 4 </h4> 

<h5>This is  Heading 5 </h5> 

<h6>This is  Heading 6 </h6> 

Output:

This is Heading 1

This is Heading 2

This is Heading 3

This is Heading 4

This is Heading 5
This is Heading 6

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top