I am trying to validate my client site which I actually customized with wordpress BUT when I tried to validate it is not validating and showing error such as "Line 414, Column 9: document type does not allow element "ul" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag <ul>" " The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element. One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>"). " This is the coding that refers to the error(this is the actual footer.php): <!--footer--> <div class="clear"></div> <div id="footer"> <div id="footer-info"> <div style="float: left; width: 964px;"> <div style="float: left; width: 238px;"> <?php echo('Site Map'); ?><br /><br /> <ul> <li><a href="http://brisbanebusinessaccountant.com.au/why-us/"> Why Us</a></li> <li><a href="http://brisbanebusinessaccountant.com.au/about-us/"> About Us</a></li> <li><a href="http://brisbanebusinessaccountant.com.au/team/"> » Our Team</a></li> <li><a href="http://brisbanebusinessaccountant.com.au/mission/"> » Our Mission</a></li> <li><a href="http://brisbanebusinessaccountant.com.au/testimonials/"> » Testimonials</a></li> <li><a href="http://brisbanebusinessaccountant.com.au/faq/"> » FAQ</a></li> <li><a href="http://brisbanebusinessaccountant.com.au/services/"> Services</a></li> <li><a href="http://brisbanebusinessaccountant.com.au/tax/"> » Tax</a></li> <li><a href="http://brisbanebusinessaccountant.com.au/bas/"> » Quarterly BAS</a></li> <li><a href="http://brisbanebusinessaccountant.com.au/smsf/"> » SMSF</a></li> <li><a href="http://brisbanebusinessaccountant.com.au/financial-services/"> » Financial Services</a></li> <li><a href="http://brisbanebusinessaccountant.com.au/business-advice/"> » Business Advise</a></li> <li><a href="http://brisbanebusinessaccountant.com.au/cfo/"> » Virtual CFO</a></li> <li><a href="http://brisbanebusinessaccountant.com.au/bookkeeping/"> » Bookkeeping</a></li> <li><a href="http://brisbanebusinessaccountant.com.au/blog/"> Blog</a></li> <li><a href="http://brisbanebusinessaccountant.com.au/resources/"> Resources</a></li> <li><a href="http://brisbanebusinessaccountant.com.au/free-stuff/"> » Free Stuff</a></li> <li><a href="http://brisbanebusinessaccountant.com.au/links/"> » Useful Link</a></li> <li><a href="http://brisbanebusinessaccountant.com.au/contact/"> Contact</a></li> </ul> </div> <div style="float: right; width: 200px;"> <?php _e( 'Follow us: ', 'thememagic' ); ?><br /><br /> <a href="#" ><img src="/wp-content/uploads/images/facebook.png" alt="" title="" height="40px" width="40px" /></a> <a href="#" ><img src="/wp-content/uploads/images/googleplus.png" alt="" title="" height="40px" width="40px" /></a> <a href="#" ><img src="/wp-content/uploads/images/twitter.png" alt="" title="" height="40px" width="40px" /></a><br /><br /><p> </p> <p>Address: <br />PO Box 1753, Capalaba QLD 4157</p> <p>Email : <br /></p> </div> <div style="width: auto;"> <?php echo('Servicing Areas:'); ?><br /><br /> <span style="color:#464646;"> <ul> <li>• Capalaba</li> <li>• Birkdale</li> <li>• Cleveland</li> <li>• Alexandra Hills</li> <li>• Surrounding Areas of Redlands</li> <li>• Brisbane Metro Area</li> </ul></span> <br /> <?php echo('Areas serviced also include, but are not limited to:'); ?><br /><br /> <span style="color:#464646;"> <ul> <li>• Wellington Point</li> <li>• Victoria Point</li> <li>• Thornlands</li> <li>• Ormiston</li> <li>• Wakerley</li> <li>• Carindale</li> <li>• Chandler</li> <li>• Mt Gravatt</li> <li>• Springwood</li> </ul></span> </div> </div> <br /><p> </p> <br /><p> </p> </div> </div> <?php wp_footer(); ?> </body> </html> Pleas HELP... Thanks in advance!
Hi Romeo M, You are using an ul in an inline object span. I would suggest to remove the span attribute and give the ul either an ID or a Class. Hope this helps you out, Kind regards, Maarten
Or switch to a DIV, though marht is quite right in that there's probably no legitimate reason to have that outer wrapping element in the first place. There are two major types of elements, inline-level and block-level -- and block level can't go inside inline-level ones. HTML 'level' and CSS 'display' are NOT the same thing, even if HTML 'levels' DEFAULT to their CSS equivalent, that's not what it means! If you lose track of which tags are which on that, I like this (older) HTML reference: http://htmlhelp.com/reference/html40/ Since as you can see on UL's page: http://htmlhelp.com/reference/html40/lists/ul.html it says not only what it can contain (LI) but also what it can be contained in. Of course with the clearing DIV like it's still 2001, extra DIV quite possibly for nothing, non-breaking spaces for *** knows what (some of which look like they should be a nested list), presentational style inlined in the markup and what is quite obviously a inaccessible fixed width layout, you've got a lot of other issues in there.
so it is the span making the issue... if I replace span tag into div tag and just declare a css script for the colorization of text, would that be help???
Yes, though since ALL you are doing with the span is setting the color, why not just set it on the UL? Don't waste extra DOM elements when you aren't doing anything useful with them that couldn't be applied directly to your semantic tags -- like that UL.
Thanks guys, you really help me a lot. I change the span into div and everything is passed now when validating the site... Thanks you deathshadow and marht!!!!