An HTML form is an essential tool for collecting information from users on a website. It allows you to create dynamic interactions and collect valuable data. In its structure, we find several key tags.
The label ""is used to group form elements together. It provides a logical container for all related elements within the form.
The label ""is used to add a description or title to the group of form elements contained in the "". It serves to provide a brief explanation or instruction related to the set of elements.
The label ""is used to associate a descriptive label with a specific form element. It provides readable text describing the purpose or function of the input field. The ""is used in combination with the "for" attribute to establish the association with the form element.
The attribute "for"is used in the label ""to indicate which form element it refers to. The value of the "for" attribute must match the value of the "id" attribute of the form element to which it is to be associated.
The label ""is one of the most commonly used in HTML forms. It defines an input field where users can enter data. It can have different types, such as text, password, number, date, among others. In addition, the "id"is used to uniquely identify a form element within the HTML document.
In summary, an HTML form is composed of tags such as "
friendsbook
Update Profile Information
@import url('https://fonts.googleapis.com/css2?family=Fredoka+One&family=Lato:wght@300&display=swap');
h1 {
font-family: 'Fredoka One', italic;
}
body {
text-align: center;
font-family: Lato;
display: grid;
background: seashell;
}
form {
width: 80%;
margin: auto;
}
label {
float: left;
width: 50%;
}
input,
textarea {
float: left;
width: 50%;
margin: 10px;
padding: 10px;
background: lemonchiffon;
font-family: Lato;
border: none;
}
fieldset {
margin: 10px;
font-weight: bold;
background: #FEFEFE;
}
button {
background: plum;
font-size: 15px;
padding: 10px;
border: none;
float: right;
color: white;
}
legend {
background: #F76C6C;
padding: 5px;
color: white;
}
Example 2:
Add Shipping Address
Amazon
Add a new shipping address
html,
body {
height: 100%;
width: 500px;
margin: 0 auto;
}
body h1 {
text-align: center;
color: orange;
}