HTML web page consists of Elements and Tags. Let us understand them in detail.
The < tag-name > make a HTML tag. For example <p> is a Paragraph tag.
Opening < tag-name > some content followed by closing </ tag-name > make a HTML element. For example <h1> Hello World!</h1> is an element consisting of opening heading tag then a text "Hello World" followed by closing heading tag.
In HTML code you have to open and close tags to make an HTML element. That is, a content must be enclosed within a matching opening and closing tags to make up a HTML element.
Conside the following HTML code.
The opening and closing body tag encloses the h1 tag. And the opening and closing h1 tag encloses the text "Hello World!".
If the tags are not properly matched and closed then it gives unexpected or invalid result.
For example, conside the following invalid HTML code.
These are the HTML elements without any content. For example the break line tag <br> has no closing tag and no content. So, its an empty element.
Have fun learning :-)
Copyright © 2014 - 2019 DYclassroom. All rights reserved.
rendered in 0.0176 sec