Use of elements in HTML
HTML element is defined by start and end tag.HTML Element helps you to insert content.
where the element name is preceded by a forward slash as shown below with few tags −
Writing method of Element :
<tagname>Content goes here…</tagname>
As we know ,Elements that starts with start tag and end with end tag.
That is predicted by start tag <> and end tag </>
|Start tag||Element content||End tag|
|<h1>||My First Heading||</h1>|
|<p>||My first paragraph.||</p>|
At the above example there is <h1> tag helps you to start write heading and </h1> is the closing point of heading.
When required to write the paragraph we start with <p> and completing the paragraph by closing </p>tag.
If we would like a paragraph break we use <br>.
HTML allows you to write nested element.When we try to design the webpages there we use nested element.
Its means elements can contain content.
<title>Nested Elements Example</title>
<h1>This is <i>italic</i> heading</h1>
<p>This is <u>underlined</u> paragraph </p>
Below are the result of the above code.
This is italic heading
This is underlined paragraph