www.webdeveloper.com
Results 1 to 3 of 3

Thread: List for nav bar not validating and I can't resolve the issue.

Hybrid View

  1. #1
    Join Date
    Jul 2012
    Location
    Vantaa, Finland
    Posts
    125

    List for nav bar not validating and I can't resolve the issue.

    I have created a nav list for my website but the html validator is showing errors for html4. I haven't been able to resolve it. Can you help me?

    The issue is that an error message is given for using <nav>. If I remove this the <li> tags show as an error. If I remove them I might as well go for a pint and forget about it..

    This is the html code.

    HTML Code:
    <div id="menu">
    <nav>
     <ul>
      <li><a href="index.html">Home</a></li>
      <li><a href="">Studies</a>
       <ul>
        <li><a href="study_what_christians_believe.html">What do Christians believe about God?</a></li>
        <li><a href="study_accepted.html">Accepted as you are</a></li>
        <li><a href="study_reconciliation.html">Reconciliation</a></li>
        <li><a href="study_baptism.html">What is Baptism?</a></li>
        <li><a href="study_forgiveness.html">Forgiveness</a></li>
        <li><a href="study_the_holy_spirit.html">The Holy Spirit</a></li>
        <li><a href="study_the_devil.html">Satan, the Devil</a></li>
        <li><a href="study_1_kings_and_elijah.html">1 Kings and Elijah</a></li>
       </ul></li>
      <li><a href="">Books</a>
       <ul>
        <li><a href="book_christians_believe.html">What do Christians believe about God, Jesus and the Holy Spirit?</a></li>
        <li><a href="book_all_studies.html">All 8 Bible Studies</a></li>
        <li><a href="both_books.html">Both Books Combined</a></li>
       </ul></li>
      <li><a href="author.html">Author</a><li>
      <li><a href="http://what-do-christians-believe.co.uk/wp/category/food-for-thought-blogs/">Food For Thought Blog</a></li>
      <li><a href="">Contact Us</a>
       <ul>
        <li><a href="contact-what-do-christians-believe.html">Simple Form - preferred method</a><li>
        <li><a href="MAILTO:info@what-do-christians-believe.co.uk">By email</a><li>
       </ul><li>
      <li><a href="sitemap.html">Site Map</a></li>
     </ul>
    </nav> 
    </div>
    For studies and books I have use <li><a href="">Studies</a> as they don't do anything except reveal a sub menu. Is this the correct way to stay on page/url?

    What do I need to do to get it to validate?

  2. #2
    Join Date
    Mar 2011
    Posts
    1,139
    <nav> is an HTML 5 element. Your page won't validate with that element unless you use an HTML 5 <!DOCTYPE>.
    Rick Trethewey
    Rainbo Design

  3. #3
    Join Date
    Feb 2013
    Posts
    91
    You have this
    HTML Code:
    <div id="menu">
      <nav>
        <ul>
          <li><a href="index.html">Home</a></li>
          <li><a href="">Studies</a>
            <ul>
              <li><a href="study_what_christians_believe.html">What do Christians believe about God?</a></li>
              <li><a href="study_accepted.html">Accepted as you are</a></li>
              <li><a href="study_reconciliation.html">Reconciliation</a></li>
              <li><a href="study_baptism.html">What is Baptism?</a></li>
              <li><a href="study_forgiveness.html">Forgiveness</a></li>
              <li><a href="study_the_holy_spirit.html">The Holy Spirit</a></li>
              <li><a href="study_the_devil.html">Satan, the Devil</a></li>
              <li><a href="study_1_kings_and_elijah.html">1 Kings and Elijah</a></li>
            </ul>
          </li>
          <li><a href="">Books</a>
            <ul>
              <li><a href="book_christians_believe.html">What do Christians believe about God, Jesus and the Holy Spirit?</a></li>
              <li><a href="book_all_studies.html">All 8 Bible Studies</a></li>
              <li><a href="both_books.html">Both Books Combined</a></li>
            </ul>
          </li>
          <li><a href="author.html">Author</a>
          <li>
          <li><a href="http://what-do-christians-believe.co.uk/wp/category/food-for-thought-blogs/">Food For Thought Blog</a></li>
          <li><a href="">Contact Us</a>
            <ul>
              <li><a href="contact-what-do-christians-believe.html">Simple Form - preferred method</a>
              <li>
              <li><a href="MAILTO:info@what-do-christians-believe.co.uk">By email</a>
              <li>
            </ul>
          <li>
          <li><a href="sitemap.html">Site Map</a></li>
        </ul>
      </nav>
    </div>
    Your problem is probably here:
    HTML Code:
          <li><a href="author.html">Author</a>
          <li>
    and here:
    HTML Code:
          <li><a href="">Contact Us</a>
            <ul>
              <li><a href="contact-what-do-christians-believe.html">Simple Form - preferred method</a>
              <li>
              <li><a href="MAILTO:info@what-do-christians-believe.co.uk">By email</a>
              <li>
            </ul>
          <li>
    and like stated before you're not using HTML5
    Last edited by Strider64; 04-05-2013 at 08:57 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles