ad

Tuesday, December 30, 2025

HTML label tag example

HTML  label tag example

web designing theory

Syntax 

 Syntax of HTML <label> tag

<label>.. .Label text.....</label>

HTML  label tag example
Example 

<!DOCTYPE html>
<html>
<head>
    <title> HTML label tag  </title>
</head>
<body>
<h1>  HTML label tag</h1>
    <label>Your Name :</label><br>
    <label>Your Class: </label><br>
    <label> Your Address:</label><br>
    <label>Your ID :</label><br>
</body>
</html>

HTML  label tag example
Explain Program

Step  1] 

<!DOCTYPE html>

  • This declare the document type.
  • browser that the document is written in html

Step 2 ]

<html>.... . </html>

  • html is the root element of the html page.
  •  Every thing inside it is part of the webpage.

Step 3]

<head>
     
  <title> HTML label tag </title>
    </head>

  •   <head>  section 
  •   head section contains metadata about page. not visible on the page itself.
  •  <title> tag  title section set the title of the page shows the browser tab. 

 Step 4]

<body>
<h1>  HTML label tag</h1>
    <label>Your Name :</label><br>
    <label>Your Class: </label><br>
    <label> Your Address:</label><br>
    <label>Your ID :</label><br>
</body>

  • <body> body contains the visible content webpage.
  • <HTML <body> main part of webpage.
  • html <h1> tag  heading. 
<label>Your Name :</label><br>
    <label>Your Class: </label><br>
    <label> Your Address:</label><br>
    <label>Your ID :</label><br>

  • html use<label> tag inside the <body>  of HTML webpage
  • HTML <label> tag  represent text description for input field.
  •  <label> tag use display text label use for form field.
  • HTML <label> displays line break.
  • HTML  <BR> tag  line break.
Step 6]

   Closing tag


</body>
</html>

HTML  label tag example

Output

HTML  label tag example







Related Post :-

what is the dl tag in html

how to create table tag in html

how to use the pre tag in html