HTML ELEMENTS


 HTML ELEMENTS

An HTML element is usually composed of a "Start Tag". "Element Content" and an "End Tag". It also known as paired tags.

Example 1:

<p> Learning HTML Elements. </p>

Output:

Learning HTML Elements.


The example HTML. Element above is composed of the following:

Start tag: <p> This is an element.

Content: Learning HTML Elements, Element content.

End tag: </p>

Nested HTML Elements

There are some cases that an HTML clement can contain, one or more HTML elements. 

For you to better understand it look at the example code below.

Example

<p><i> Nested HTML Element</i></p>

Output:

Nested HTML Elements.


The example nested HTML Elements above are composed.of the following:

Start tag. <p> Start tags <i>

Element Content: Nested HTML Elements.

End tags: </p> </i>

On the example above, there are two start tags and two endtags.

Empty Elements

Empty Elements are elements that do not have an element content and an end tag. A list of commonly used Empty Elements. it is also called as unpaired tags. 

  • <meta?>
  • <link/>
  • <img/>
  • <br/>
  • <hr/>
  • <input/>

In HTML Empty Elements is to always put a forward slash / sign before the greater than > sign. In this way they are closed at their start tags.

There are two types of elements 

  1. Inline element
  2. Block element
INLINE ELEMENT 

     Inline element occupies content width. so its do not begin on a now line are known as inline element

BLOCK ELAMENT 

    Block element occupies 100% of width . so its begin with new line are known as block element.

SELF CLOSING TAGS:

tags Self closing tags d not have a parent tag where the first tag is the only necessary tag that is valid for the formatting.

Example:

<img src="ramakrishna.jpg"></img>

CONTROL TAGS AND CONTAINER TAGS

Input tags are called control tags and output tags are called container tags.