Hoping some of you may help with a question that I frequently see implemented differently? Should the form 'label' element (<label></label>) wrap around the form elements that they are a label for (almost like a container), or should they be left on their own? I have seen some keep the form labels separate from say a input field, but then wrapped around multiple elements, like say radio buttons.
 
I hope I am making myself clear? For example:
 
LABEL - NOT WRAPPING:
  <label for="">Rate this example</label>
        <select name="rating_select" id="rating_select" size="3" multiple="multiple">
          <option value="1">1</option>
          <option value="2">2</option>
          <option value="3">3</option>
          <option value="4">4</option>
          <option value="5">5</option>
        </select>
 
LABEL - WRAPPING:
  <label for="">Rate this example
        <select name="rating_select" id="rating_select" size="3" multiple="multiple">
          <option value="1">1</option>
          <option value="2">2</option>
          <option value="3">3</option>
          <option value="4">4</option>
          <option value="5">5</option>
        </select>
  </label>
I assume the first example provides for more power/control over the design/positioning of a label, but I guess my question is about semantic correctness rather than the best option for presentation (CSS) control.
 
Regards
 
Nathan
 
 
 

Reply via email to