HTML label tag example
Syntax
Syntax of HTML <label> tag
<label>.. .Label text.....</label>
<label>.. .Label text.....</label>
HTML label tag example
Example
<!DOCTYPE html>
<html>
<head>
</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>
