This content originally appeared on Manuel Matuzović - Web development blog and was authored by Manuel Matuzović
…if you're putting the word “label” in the classname, you want to use a <label>
element.
<div class="form-item__label">
Username
</div>
<input type="text">
More accessible alternative:
<label for="username" class="form-item__label">
Username
</label>
<input id="username" type="text" autocomplete="username">
Explanation
The <label>
element provides a form field with a visual and a semantic label.
My blog doesn't support comments yet, but you can reply via blog@matuzo.at.
This content originally appeared on Manuel Matuzović - Web development blog and was authored by Manuel Matuzović

Manuel Matuzović | Sciencx (2023-04-19T09:46:54+00:00) label element. Retrieved from https://www.scien.cx/2023/04/19/label-element/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.