New! My 44-page ebook "CSS in 44 minutes" is out! 😃

Get it now →

# select

Defines a select dropdown with different <option> elements.

Example: Copy

<select name="country">
  <option value="Argentina">Argentina</option>
  <option value="Bolivia">Bolivia</option>
  <option value="Brazil">Brazil</option>
  <option value="Chile">Chile</option>
  <option value="Colombia">Colombia</option>
  <option value="Ecuador">Ecuador</option>
  <option value="Guyana">Guyana</option>
  <option value="Paraguay">Paraguay</option>
  <option value="Peru">Peru</option>
  <option value="Suriname">Suriname</option>
  <option value="Uruguay">Uruguay</option>
  <option value="Venezuela">Venezuela</option>
</select>

name

Defines the unique identifier for that select within the form.

Required.

"countries"

The name value must be unique within the context of a <form> container.

It can only contain alphanumeric characters a-z A-Z 0-9 and some special characters like - _… but no space.

size

When multiple is present too, defines the height of the select list

"12"

You can use any integer.

multiple

Allows to select multiple options at once.

No value required.

autofocus

Sets focus on the select when the web page loads.

No value required.

disabled

Disables the button.

No value required.

required

Tells the browser that this select is required. Leaving it empty will show a warning.

No value required.