HTML label tag example

HTML  label tag example

web designing theory

This Blog You Will Learn 

What is the <label> Tag

 Syntax of HTML <label> ta

HTML  label tag example

Output

What is the <label> Tag
  1. <label> tag provides a text label form controls<input> ,<textarea>,<select>tag etc.
  2. HTML <label> tag use to describe form elements. input boxes,checkboxes,radio buttons,text areas. 
  3. HTML  <label> tag use to define a text description for form element.
  4. HTML <label> tag input field.

 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

Comments

Popular posts from this blog

What Is CSS Text Color in 2026

CSS Padding Property Explained

CSS Outline Color Property in 2026