Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7552477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T10:46:04+00:00 2026-05-30T10:46:04+00:00

I am using HTML5 and in the process of validating, this error is throughout

  • 0

I am using HTML5 and in the process of validating, this error is throughout my pages. I am using PHP within my code as well, I don’t know if this is causing the error. The error is:

Element li not allowed as child of element div in this context

Here is one DIV that brings up this error:

<div class="signin">
<?php

if (isset($_SESSION['userID'])){

echo"
<li><a href='logout.php'>Logout</a></li>";}

else{ echo "
<li><a href='signin.php'>Sign in</a></li>
<li><a href='register.php'>Register</a></li>
  ";}?>
</div>

And here is another:

    <div class="navigation">


<li class="navbutton <?php if($navsection == 'home') {echo ' current';}?>" id="navbuttonleft" >
  <a href="index.php">Home</a></li>

    <li class="navbutton  <?php if($navsection == 'products') {echo ' current';}?>">
      <a href="products.php?main=go">Products</a></li>

          <li class="navbutton" <?php echo ($navsection == 'myaccount') ? ' class="current"' : ''; ?>>
          <a href="myaccount.php">My Account</a></li>

             <li class="navbutton" <?php echo ($navsection == 'about') ? ' class="current"' : ''; ?>>
             <a href="aboutus.php">About us</a></li>

                 <li class="navbutton" <?php echo ($navsection == 'contact') ? ' class="current"' : ''; ?>>
                  <a href="contactus.php">Contact Us</a></li>

                        <li class="navbutton" <?php echo ($navsection == 'sitemap') ? ' class="current"' : ''; ?>>
                          <a href="sitemap.php">Site Map</a></li>



</div>

Any suggestions are appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T10:46:05+00:00Added an answer on May 30, 2026 at 10:46 am

    HTML (even HTML5) follows rules by which the elements may be nested to structure your document semantically. In your case, the error means you forgot to wrap the <li> elements into a <ul>, <ol> or <menu> element, e.g. you forgot to denote beginning and end of a list.

    Quoting http://dev.w3.org/html5/html-author/#the-li-element

    4.3.5.9 The li element

    The li element represents a list item.

    Start tag: required
    End tag: optional
    Categories: None.
    Contained By:

    • Inside ol elements.
    • Inside ul elements.
    • Inside menu elements.

    Content Model: Flow content.

    Example

    <ul>
       <li>Unordered First Item with Ordered Sublist
           <ol>
               <li>Ordered First Item</li>
               <li>Ordered Second Item</li>
               <li>Ordered Third Item</li>
           </ol>
       <li>Unordered Second Item</li>
       <li>Unordered Third Item</li>
    </ul>
    

    Output

    • Unordered First Item with Ordered Sublist
      1. Ordered First Item
      2. Ordered Second Item
      3. Ordered Third Item
    • Unordered Second Item
    • Unordered Third Item
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While using xmlstarlet on web pages, I most of time faced entity reference error.
I'm experimenting with using html5 and css counters to number the figures in a
I am looking at using HTML5 Canvas element for my upcoming project. I want
I'd like to start using HTML5's basic features, but at the same time, keep
I'm using the HTML5 elements and in a project i'm working on and the
I feel stupid... my desire is to write HTML5 using XML and I can't
Im using JavaScript, the HTML5 canvas-element and WebGL to make a simple 3D-game in
Currently I am using Canvas2Image to save the content of my HTML5 canvas. It
HTML5 will be next super star. So~~~How to using new idea to implement AJAX
HTML5 draft contains an API called EventSource to stream data (notifications) trough javascript using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.