Loading Please Wait...

Logo Lynxsia IT Solutions

HTML Elements

HTML Elements

HTML Elements are the main building block of an HTML document. An HTML element is a combination of start tag, end tag, and content for the elements.

A tag is a name written in the form of <tagname>. Where </tagname> represent the ending of the tag.

An HTML Element is written like below

<tagname>Content For Element</tagname>

For Example

<h1>Some Heading</h1>

Container Elements

HTML Elements having a start tag, end tag, and content in between are called Container Elements, Paired Elements.

For example: <h1>Some Heading</h1>, <p>Some Paragraph</p>

Empty Elements

HTML Elements having no content and are only defined by the start tag are called Empty Elements, Unpaired Elements.

For example: <br>, <hr>, <img>, etc.

Nested Elements

HTML Elements that contain other elements are called Nested Elements.:

For example: <html>Other Elements</html>

Let's see with some example
					 
        
          <!DOCTYPE html>
          <html>
            <head>
              <title>My First Web Page - Lynxsia IT Solutions</title>
            </head>
            <body>
              <h1>My First Heading</h1>
              <p>My first paragraph. <br> Another line in paragraph</p>
            </body>
          </html>
        
      
Common Mistake

The most common mistake we usually do in writing HTML documents is we forget to write the end tag. This doesn't make any difference in displaying content but unexpected results may occur during layout and formatting. So never miss the end tag.

Sometimes we misspelled the tag name. So be careful in writing tag names.

Let's see with some example
					 
        
          <!DOCTYPE html>
          <html>
            <head>
              <title>My First Web Page - Lynxsia IT Solutions</title>
            </head>
            <body>
              <h1>My First Heading
              <p>My first paragraph. <br> Another line in paragraph</p>
            </body>
          </html>
        
      
Example Explanation

In the above example, we forget to close the h1 heading. This will cause the paragraph to be shown as the heading too.

Elements Case Sensitivity

HTML elements are not case-sensitive. You can use either uppercase, lowercase, or mixed letters to write tags. For example, <html>, <HTML>, and <Html> all are same. But W3C recommends using lowercase for the tag name and demands lowercase for stricter document types like XHTML

We also use lowercase for the tag name as per the standard
Let's see with some example
					 
        
          <!DOCTYPE html>
          <HTML>
            <head>
              <title>My First Web Page - Lynxsia IT Solutions</title>
            </head>
            <Body>
              <H1>My First Heading</H1>
              <P>My first paragraph. <br> Another line in paragraph</p>
            </Body>
          </HTML>
        
      

How you feel about this blog:

Share this blog on:

Report Us

If you find any error in the turtorials, or want to share your suggestion/feedback, feel free to send us email at: info@lynxsia.com

Contact Us
Ads
Logo
Lynxsia IT Solutions

We are concern with various development process like website design & development, E-commerce development, Software development, Application development, SMS & Bulk SMS Provider, PWA Development, and many more..

Kotwali Road, Chhiptehri, Banda, 210001, UP, India

Copyright © 2022, Lynxsia IT Solutions, All rights reserved