Core HTML Tags Overview

Forms and Input

1. Forms (<form>)

Forms are used to collect user input. The <form> element wraps the entire form.

HTML Example:

<form action="/submit_form" method="post">
    <label for="name">Name:</label>
    <input type="text" id="name" name="name">
    <input type="submit" value="Submit">
</form>

Explanation:

2. Inputs (<input>)

The <input> tag is used to create various form controls.

HTML Example:

<input type="text" name="username" placeholder="Enter your name">
<input type="password" name="password" placeholder="Enter your password">
<input type="radio" name="gender" value="male"> Male
<input type="radio" name="gender" value="female"> Female
<input type="checkbox" name="subscribe" value="yes"> Subscribe to newsletter
<input type="submit" value="Submit">

Explanation:

Male Female Subscribe to newsletter

3. Labels (<label>)

The <label> tag is used to provide a label for an <input> element. It helps improve accessibility.

HTML Example:

<label for="email">Email:</label>
<input type="email" id="email" name="email">

Explanation:

Previous Next
Modern Footer