What are HTML Elements?
It contains starting tag and ending tag between<Tag name> </Tag name> this tags add contents or text.
<tags> Write your content here..</tags>
What is Nested HTML Elements?
HTML Element inside other element is called Nesting of an element.
Syntax:
<>Starting tag
Inside this the other element
</>Ending tag
Example for Nested Elements
<p>This is <em>Emphasize</em> Text</p> <p>This is <b>bold</b> text</p>
In the above example <em> and <b> tags are inside <p> tag so, tag inside tag is nested HTML elements.
Start Tag | Contents | End Tag |
---|---|---|
<p> | Write content of your paragraph | </p> |
<title> | Give title to the document | </title> |
<h1> | Mention heading of the document | </h1> |
Example for nested Elements
<p>This is <em>Emphasize</em> Text</p> <p>This is <b>bold</b> text</p>
Interview Questions & Answer
HTML element contains the starting tag and ending tag. It contains contents between them.
For example,
<h2> This is the heading </h2>.
An HTML Element represents some kind of structure or semantics and generally consists a start tag, content, and an end tag. A Tag consists of starting and ending point and it is used to create the structure of the HTML document.
If HTML contains a tag inside a tag it is known as a nested list in HTML.
For example,
<h1>My first <i>paragraph</i>in HTML</h1>.
Here, <p> and <i>both are tags.
But<i> tag is placed inside a <p> to format ‘paragraph’ word in italic.