Hi. I recently discovered that my website has some W3 validation errors that I do not understand. I hope that some of you will be able to shed some light on these errors. I got many errors (up to 72 errors on a page) and they are basically the same throughout the website. Below I have copied the code and the validation errors I get. I have removed a lot of text to shorten it down.
Line 60, Column 13: document type does not allow element "br" here; assuming missing "li" start-tag
<br /> <!-- Underpunkt -->
Line 61, Column 11: document type does not allow element "li" here; missing one of "ul", "ol", "menu", "dir" start-tag
<li><a href="uses_of_nightvision.html">Uses of Night Vision</a></li>
Line 66, Column 12: end tag for "li" omitted, but OMITTAG NO was specified
</ul> <!-- end inner UL -->
Line 60, Column 8: start tag was here
<br /> <!-- Underpunkt -->
Line 137, Column 9: end tag for "li" omitted, but OMITTAG NO was specified
</ul> <!-- end main UL -->
Line 123, Column 6: start tag was here
<li> <li> <a href="#">About us</a> <!-- Hovedpunkt -->
Line 304, Column 28: end tag for "p" omitted, but OMITTAG NO was specified
<!-- end .footer --></div>
04-10-2013, 10:16 AM
Remove the br tags between the li tags in your main navigation, they're not valid, and you can use CSS to add a bottom margin to the li elements
04-10-2013, 10:39 AM
Thank you for your help which I appreciate. I am not savvy in CSS. I just started using CSS a couple of months ago. Can you tell me how I should do it?
Do you have an idea about the other errors I am getting?
04-10-2013, 01:10 PM
It would have been more helpful to have provided a link to page so we could see the line numbers at the W3C. Also, not sure what document type you are validating against although guess is XHTML something because of "<br />" used.
1) Line 60: Break tags are not allowed between list tags.
2) Line 61: Make sure opening/closing tag pairs match although I think this will disappear after removing break tags.
3) Lines 66, 60, 137, 123: Probably flagged as errors because of previous errors.
4) Line 304: No closing "p" tag.
04-10-2013, 01:20 PM
Dear Major Payne,
Thanks for your reply. Yes, I guess that most of these errors is because of the break tags which I have removed. However the problem is when the break tags are removed the menu navigation bar will appear horizontally instead of vertically. Here you can see the W3C error pages. I have put 2 links where you can see the difference in having br tags versus no br tags. And trying to use W3C suggested break tag "<li class="c1"><br /></li>" does not do any good.
Why do you need the breaks? The nav menu looks good running across the top.
04-10-2013, 06:17 PM
Hi. I have uploaded the correction you told me to and it removed a lot of the earlier errors. However now the navigation bar runs horizontally instead of vertically. You can see the horizontal version after the correction here and it should be like this
04-10-2013, 06:18 PM
Oh, I meant to say that you need to hoover over the links in the menu bar navigation to see it.
Thank you for your efforts. You truly have been patient and helpful. When I am checking the page using firefox it looks like it should but when using safari the menubar navigation comes down horizontally instead of vertically. I wonder why that is.
04-10-2013, 10:29 PM
Just checked my version in Safari and it looks very close to what it looks like in Fx.
04-10-2013, 11:04 PM
Hmm, I wonder why we are seeing different things. I have checked www.goblinnightvision.com/test.html in safari, firefox and google chrome and both safari and google chrome shows the dropdown menu bar horizontally instead of vertically.
04-10-2013, 11:17 PM
If you are not using the code I posted on Pastebin, then that may be your problem. All errors were removed except for those I have no control over or shouldn't change. See attached images for both browsers using the HTML file on my computer of your page.