There is a slight difference between HTML elements and tags. Tags are in source code while elements are in processed tags
HTML elements:
An element is the building block of HTML.And it consist of two basic tags:
1. Opening tag
2. Closing tag
In other words, elements are the entire HTML block that creates a paragraph. An element in HTML represents some kind of structure and consists of a start tag, content, and an end tag. The following is a paragraph element:
<p>
Life is like a race. There come a lot of ups and downs in a life of a man. But he has to face them with patience.
</p>
This complete thing is called HTML element.
Some HTML elements <br> do not have a closing tag. such type of elements are called “void “elements. Void elements are easy to use because we can include only one tag in our web page. Elements can be defined in a certain order.
HTML tags:
HTML tag is just opening or closing entity. Tags are used to mark up the start and end of an HTML element’s start tag consist of an opening angle bracket (<) followed by the element name, value pairs and closing angle bracket (>).
</p>
1. A start tag with no attributes:
<p>
2. A start tag with an attribute:
<p class=”gull”>
End tag consists of an opening angle bracket followed by a forward slash, the element name and closing angle bracket:
3. </p>
There are also some elements that are empty its mean that it consist of a single tag and do not have ant content. in HTML such type of tags look like opening tags:
4. <br>
0 comments:
Post a Comment