<h2>label + input</h2>
<label for="first-name">First Name</label>
<input id="first-name" type="text" name="textfield">

<h2>input with <code>aria-label</code></h2>
<input id="first-name" aria-label="First Name" type="text" name="textfield">

<h2>input with <code>aria-labelledby</code></h2>
<h3 id="first-name-label">First Name</h3>
<input id="first-name" aria-labelledBy="first-name-label" type="text" name="textfield">

<h2>input with a <code>title</code> attribute</h2>
<input title="First Name" id="first-name" type="text" name="textfield">
label,
input {
  display: block;
}
Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.