View Single Post
  #3 (permalink)  
Old 08-18-2008, 06:15 PM
hughes hughes is offline
WebProWorld New Member
 
Join Date: Jul 2008
Posts: 2
hughes RepRank 0
Default Re: CSS: <label> ignores width styling

Thanks for the reply. It may have to do sth with inline vs. block-level elements. But wrapping labels around input fields is definitely allowed. W3.org, the HTML standards body, even has an example showing this technique in the HTML specs:
Forms in HTML documents
(see third example at 17.9.1 "The LABEL element")

I wanted to use this to avoid cluttering up my code with so many divs, instead just styling fieldsets and labels directly.

But anyway, yes, it does seem like <label> behaves like an inline element by default. So I guess all inline elements can't have width styles?
Reply With Quote