What is the purpose of HTML element?

LAST READ: APR 15 2024 | Q. BY: HEMANGA SAIKIA

V

Viktam Thakur

PURPOSE OF HTML ELEMENTS


An HTML [Hypertext Markup Language] elements are a type of HTML document component, one or several types of HTML nodes including text nodes, comment nodes, and other nodes. It means that HTML elements are a set of tags and attributes that define different parts of web documents and inform web browsers how to display them. 


An HTML document is a text file that contains the tag-based information to publish. It also contains embedded instructions called “Elements”. For generally understood, the position of an element is indicated as spanning from a start tag, possibly including some child content, and is terminated by an end tag.



Syntax of HTML Elements


An HTML element usually consists of an open_tag like ('<>') and a close_tag like ('</>') with the content inserted in between open_tag & close_tag.


<open_tage>Contents write here...</close_tag>



Types of HTML Elements


  • Nested HTML Elements
  • Empty HTML Elements [<br />, <hr />, etc...]
  • Nested HTML Elements Example:


Demo Example


<html>

<head>

  <title> Define page title </title>

  <meta /> // meta tag

</head>

<body>

  <h2> Heading tag element  </h2> <br />

  <p> Paragraph tag element </p>

</body>

</html>


0 votes

Your Answer

Email Us: advertise@gdatamart.com

Donate Us: Support to GDATAMART

LifeStyle & Fun

© 2024 GDATAMART.COM (All Rights Reserved)