Tyler Matema
Tyler Matema

Reputation: 67

w3 Validate html error

I am still a newbie, I am a little confuse with what this errors mean.

 Line 30, Column 5: document type does not allow element "li" here; missing one of "ul", "ol" start-tag

i got this error all the way till line 44

and what this omitted mean?

 Line 54, Column 7: end tag for "div" omitted, but OMITTAG NO was specified

below is my code: (thanks if anyone could guide me

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en" >
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <meta name="description" content= "about" />
    <meta name="keywords" content="about" />
<title>About</title>
</head>  
    <body>
        <div id="container">
        <div id="inside">
        <div id="inside2">
        <h1>About</h1>
        <ul>
        <li>The Php version installed in mercury is <?php echo 'Current PHP version: ' . phpversion(); ?>.
        </li>
        <br />
        <li>The task I am not attempted is Task 5.
        </li>
        <br />
        <li>I am not exploring and implementing any special feature.</li>
        <br />
        <li>I have trouble mainly on Task 3 with validation.</li>
        <br />
        <li>Regarding with php, I want to gain more knowledge, I need to grasp deeper understanding on how everything works
        as there are a lot of things to remember and how things are working. The other part is I need to dramatically improve
        my time managment, although I start a week and half early, but I had trouble understanding the codes, and with other
        assignments I need to finish.</li>
        <br />
        <li>Youtube channel by the name phpacademy and thenewboston help me out to get clearer understanding about certain stuff
        in php, as well stackoverflow.com</li>
        <li>I have learn more and new codes, better understanding on how overall the code works in PHP, but still a lot to learn.</li>
        <br />
        <img src="thread.jpg" width="450" height="350" alt="Discussion Thread" />
        <br />
        <a href="index.php">Return to Homepage</a> 


        <ul>


    </body>
    </html>

Upvotes: 0

Views: 485

Answers (5)

G-Nugget
G-Nugget

Reputation: 8836

For the first message, any <li>s must be children of a <ul>. For the second message, you open three <div>s but never close them. The <br />s are also invalid and redundant; the <li>s will break lines automatically. Your HTML can be fixed as shown below:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en" >
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <meta name="description" content= "about" />
    <meta name="keywords" content="about" />
<title>About</title>
</head>  
<body>
    <div id="container">
    <div id="inside">
    <div id="inside2">
    <h1>About</h1>
    <ul>
    <li>The Php version installed in mercury is <?php echo 'Current PHP version: ' . phpversion(); ?>.
    </li>
    <li>The task I am not attempted is Task 5.</li>
    <li>I am not exploring and implementing any special feature.</li>
    <li>I have trouble mainly on Task 3 with validation.</li>
    <li>Regarding with php, I want to gain more knowledge, I need to grasp deeper understanding on how everything works
    as there are a lot of things to remember and how things are working. The other part is I need to dramatically improve
    my time managment, although I start a week and half early, but I had trouble understanding the codes, and with other
    assignments I need to finish.</li>
    <li>Youtube channel by the name phpacademy and thenewboston help me out to get clearer understanding about certain stuff
    in php, as well stackoverflow.com</li>
    <li>I have learn more and new codes, better understanding on how overall the code works in PHP, but still a lot to learn.</li>
    <li>
        <img src="thread.jpg" width="450" height="350" alt="Discussion Thread" />
        <a href="index.php">Return to Homepage</a>
    </li>
    </ul>
</div>
</div>
</div>
</body>
</html>

Upvotes: 0

Reflective
Reflective

Reputation: 3917

This should validate better.

There was two open <ul> tags and no one closing tags, 3 </div>'s were missing and lot of <br>'s b/w <li>'s.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en" >
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <meta name="description" content= "about" />
    <meta name="keywords" content="about" />
<title>About</title>
</head>
    <body>
        <div id="container">
          <div id="inside">
            <div id="inside2">
            <h1>About</h1>
            <ul>
              <li>The Php version installed in mercury is <?php echo 'Current PHP version: ' . phpversion(); ?>.</li>
              <li>The task I am not attempted is Task 5.</li>
              <li>I am not exploring and implementing any special feature.</li>
              <li>I have trouble mainly on Task 3 with validation.</li>
              <li>Regarding with php, I want to gain more knowledge, I need to grasp deeper understanding on how everything works
              as there are a lot of things to remember and how things are working. The other part is I need to dramatically improve
              my time managment, although I start a week and half early, but I had trouble understanding the codes, and with other
              assignments I need to finish.</li>
              <li>Youtube channel by the name phpacademy and thenewboston help me out to get clearer understanding about certain stuff
              in php, as well stackoverflow.com</li>
              <li>I have learn more and new codes, better understanding on how overall the code works in PHP, but still a lot to learn.</li>
            </ul>
            <img src="thread.jpg" width="450" height="350" alt="Discussion Thread" />
            <br>
            <a href="index.php">Return to Homepage</a>    
            </div>
          </div>
        </div>
</body>
</html>

Upvotes: 0

Brad
Brad

Reputation: 163232

Your <br/> tags are throwing off the validation. Remove them, or at least put them within a proper element. For the other errors, close your tags properly.

Upvotes: 1

ColdSharper
ColdSharper

Reputation: 84

check your closing ul tag at the bottom. It seems to be <ul> and should be </ul> (you have an opening tag instead of a closing tag).

Keep in mind XHTML 1.0 Strict means just that...strict.

Upvotes: 0

Haru
Haru

Reputation: 1381

Try placing a </ul> before after your last </li>. Then close your last <div> with </div>...I'm pretty sure that should do the trick. Also all the breaks are bad formatting you can change those styles using CSS, and it would be more browser compatible.

Upvotes: 0

Related Questions