HTML ELEMENTS

  • In the first lesson we have studied about tags and things like start tag ( opening tag) and end tag (closing tags).

HTML TAGS

HTML tags are elements names surrounded by an angle brackets.
In HTML we use start and end tags.

   START TAG AND END TAG

  1. Start tag - also called opening tag. example : <p>
  2. end tag - also called closing tag. example : </p>    
      An HTML element is usually composed of a "start tag " , "element content"
and an "end tag".
                 example: <P> this is an element content  </p>
  • <p>: start tag 
  • this is an element content : element content
  • </p>: end tag  

NESTED HTML

There are some cases that an HTML element can contain one are more HTML elements.

for you to better understand it look at the example code below:

                   <p><i>italicized text</i></p>              

output:

            italicized text

NOTE:TRY THIS IN NOTEPAD OR IN ONLINE COMPLIER

The example nested HTML elements above are composed of the following:
  • start tag :<p>
  • start tag: <i>
  • element content :italicized text 
  • end tag :</i>
  • end tag :</p>
On the example above, there are two start tags and two end  tags .
The second tag i.e. <i> italicizes the text within element content

EMPTY ELEMENTS

Empty Elements are elements  that do not have an element content and an end tag.
A List of commonly used empty elements :
  • <meta />
  • <link />
  • <img />
  • <br />
  • <hr />
  • <input />

The best practice in HTML empty elements  is to always put forward slash (/) sign before the greater than (>) sign .  

NEXT

HTML ATTRIBUTE            
         

Post a Comment

Previous Post Next Post