Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Jan 2012
    Location
    Walla Walla
    Posts
    10
    Thanks
    2
    Thanked 0 Times in 0 Posts

    li not allowed as child element in markup validation

    I appreciate all help to get this to validate in MarkUp. My goal is mainly to learn how to write good code.

    It is a simple <a>, anchor, in a <li>, list, and I read in google where some say it is okay to have, but I would prefer to have this page fully validate.

    It may be worth mentioning how there is a js error right before this. It doesn't like the obsolete name tag. I was going to address that after this, but I am mentioning it to make sure it is not the cause of the invalidation of the below list anchor code.

    Here is the error:
    Element li not allowed as child of element div in this context. (Suppressing further errors from this subtree.)

    http://thefamilyhunters.atwebpages.com/classyShow.html

    section of code:
    Code:
    	<div id="Second">
    		<div id="TwoOne">
    				Your content here 
    				<li><a href="../indexHunting.html">Your Links</a></li>
    				<li><a href="*">Your Links</a></li>
    				<li><a href="../indexHunting.html">Your Links</a></li>
    		</div>
    		<div id="TwoTwo">
    				Looks Good
    				<li><a href="../indexHunting.html">More Links</a></li>
    				<li><a href="../indexHunting.html">More Links</a></li>
    				<li><a href="../indexHunting.html">More Links</a></li>
    		</div>
    		<div id="TwoThree">
    				Thank You Lord Jesus
    				<li><a href="../indexHunting.html">More Links</a></li>
    				<li><a href="../indexHunting.html">More Links</a></li>
    				<li><a href="../indexHunting.html">More Links</a></li>
    		</div>
    		<div id="TwoFour">
    				One More
    				<li><a href="../indexHunting.html">More Links</a></li>
    				<li><a href="../indexHunting.html">More Links</a></li>
    				<li><a href="../indexHunting.html">More Links</a></li>
    		</div>
    	</div>
    I can add the full css sheet, if you would like. I didn't believe it was necessary because I should be able to validate the markup without the css. Correct me right, if I thought wrong.

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,737
    Thanks
    22
    Thanked 1,835 Times in 1,819 Posts
    Hello again TYJesus,
    See html lists here.

    Your li's should be wrapped in ul or ol tags.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #3
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,737
    Thanks
    22
    Thanked 1,835 Times in 1,819 Posts
    Read the rest of the error message the validator is giving you. It goes on to explain that.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #4
    New Coder
    Join Date
    Jan 2012
    Location
    Walla Walla
    Posts
    10
    Thanks
    2
    Thanked 0 Times in 0 Posts
    O, wow. It is like learning the ABC's.

    Validated nicely.

    Thank You, again, for your patience and good work Excavator.

    Yes, I am learning to validate during development. I am figuring out how often. Like, every element, or particular section, or line, or maybe it depends on how good the coder is, this is what I am discovering.
    Last edited by TYJesus; 01-16-2012 at 10:46 PM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •