Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-16-2009, 10:52 AM   PM User | #1
j05hr
Regular Coder

 
Join Date: Nov 2008
Posts: 175
Thanks: 4
Thanked 6 Times in 6 Posts
j05hr is an unknown quantity at this point
Validation

How would you validate this in xhtml strict? I had a look on google but everyone seemed to be doing it the exact same way.

Code:
<label for="contactYou" class="fixedwidth">Best way to contact you?</label>
       <select name="contactYou" id="contactYou">     
                <option>Home</option>
                <option>Work</option>
                <option>Mobile</option>    
      </select>

Error Line 111, Column 28: document type does not allow element "label" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag

<label for="contactYou">Best way to contact you?</label>

Thanks,
Josh
j05hr is offline   Reply With Quote
Old 12-16-2009, 11:08 AM   PM User | #2
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
Those elements need to be inside of a fieldset or paragraph element. A fieldset is probably most semantic. You could use a paragraph but that won't really be semantic. Neither will the other elements.
__________________
||||If you are getting paid to do a job, don't ask for help on it!||||
_Aerospace_Eng_ is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:05 AM.


Advertisement
Log in to turn off these ads.