How do I put a name to the left of the select box? Do I have to use a paragraph then move it to the left?

1 answer

danwellman 5600
1
point

use a <label> element as this is much more semantic. To make the select sit next to it you'll need to float them both (and then clear them)

Answered about 10 years ago by danwellman
  • do i put the label in html or css? canyonchase1 about 10 years ago
  • The <label> element goes in the HTML. The styling for it (the floating and clearing) goes in the CSS. Paul Farnell about 10 years ago
  • how do i put this label in. whats an example of what it will look like with the label with it? canyonchase1 about 10 years ago
  • <label>The label text</label><select><option>An Option</option></select> would be the html and label, select { float:left; } the CSS danwellman about 10 years ago