View Single Post
  #2 (permalink)  
Old 08-18-2008, 01:17 PM
wige's Avatar
wige wige is offline
Moderator
WebProWorld Moderator
 
Join Date: Jun 2006
Location: United States
Posts: 2,661
wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9
Default Re: CSS: <label> ignores width styling

I am not sure, but I think label is considered an inline element, and input is a block level element. Generally, label should not contain anything but the text, as it is a feature intended for accessibility, to link a string of text to a form field. (ie, a form element can not be part of it's own label)

I think for the best results the following code would do what you need:
HTML Code:
<div class="formelement">
   <label for="xyz">XYZ:</label>
   <input id="xyz" type="text" />
   (additional hint)
</div>
__________________
The best way to learn anything, is to question everything.
Reply With Quote