हम HTML elements को start tag ,content और end tag से define करते है। अगर element में content हो तो वह closing tag से end होता है जहा element के आगे एक slash होती है।

For Examples

Start Tag |		Content         | End Tag
-----------------------------------------------------
<p>	   | This is paragraph content. | </p>
<h1>	   | This is heading content.	| </h1>
<div>	   | This is division content.  | </div> 

तो यहाँ <p > और <p/> एक Html element है। इसी तरह <h> और <h/>  एक html element है। कई ऐसे Html elements है जिसे हमे close करने की ज़रूरत नहीं है, उन्हे हम void elements कहते है।

Html में कई ऐसे elements है जो html documents specify करते है और यह specify करते है की कोन सा content कौन से html document में होना चाहिए।

Difference between html tags and html elements

  1. Html tag content को define करता है और Html elements में opening और closing tags होते है।
  2. Html tag < से open होता है और > से close होता है  Html elements में html tag में लिखी information होती है।
  3. Html tag keyword जैसे होते है जहा हर एक word का special meaning होता है और html elements में general content होता है।
  4. Html tag में html elements होते है और html elements में content होता है।
  5. Html tag में हम element का start और end mark कर सकते है और html element start tag ,end tag और attributes का collection है।

HTML elements Example

<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>

HTML Nested elements Example

File : nested_elements.html

Copy Fullscreen Close Fullscreen Run
<!DOCTYPE html>
<html>
    <head>
        <title>Title</title>
    </head>
    <body>
        <h1>My First Heading</h1>
        <p>My first paragraph.</p></body>
    </body>
</html>

Types of elements

Html elements कुछ इस प्रकार है -

  1. void elements
  2. template element
  3. raw text elements
  4. escapable raw text elements
  5. foreign elements
  6. normal elements

HTML Block Elements

block elements की start always new line से होती है। block elements में always full width available होती है। block element में top और bottom margin होता है।

कुछ block element इस प्रकार है -

<address>
<article>
<aside>
<blockquote>
<canvas>
<dd>
<div>
<dl>
<dt>
<fieldset>
<figcaption>
<figure>
<footer>
<form>
<h1>
<h6>
<header>
<hr>
<li>
<main>
<nav>
<noscript>
<p>
<pre>
<section>

HTML Inline Elements

Inline element की start new line से नहीं होती है। inline elements अपने need के according width लेता है। यह element paragraph के अंदर लिखा होता है।

कुछ inline element इस प्रकार है -

<a>
<abbr>
<b>
<bdo>
<big>
<br>
<button>
<cite>
<code>
<dfn>
<em>
<i>
<img>
<input>
<kbd>
<label>
<map>
<object>
<output>
<q>
<samp>
<script>
<select>
<small>
<span>
<strong>
<sub>
<sup>

HTML Element Example

File : html_elements.html

Copy Fullscreen Close Fullscreen Run
<!DOCTYPE html>
<html>
  <head>
    <title>HTML Elements Example</title>
  </head>
  <body>
      <h5>h5 is a block element</h5>
      <header>header is a block element</header>
      <div>div is a block element</div>
      <blockquote>blockquote is a block element</blockquote>
      <pre>pre is a block element</pre>
      
       <span>span is an inline element</span> 
       <big>Rahul</big>
       <b>Kumar</b>

  </body>
</html>

Related Topics :

Rahul Kumar

Rahul Kumar

Hi ! I'm Rahul Kumar Rajput founder of learnhindituts.com. I'm a software developer having more than 4 years of experience. I love to talk about programming as well as writing technical tutorials and blogs that can help to others. I'm here to help you navigate the coding cosmos and turn your ideas into reality, keep coding, keep learning :)

Get connected with me. :) LinkedIn Twitter Instagram Facebook

b2eprogrammers