Link to home
Start Free TrialLog in
Avatar of Software Software
Software SoftwareFlag for Austria

asked on

W3C: Markup Validation

Hello,
I have an very old website. When I check the Markup Validation then I get several errors.

https://validator.w3.org/
For example:

1) I am using old  html-tags: applet, basefont, center, align, dir, font, isindex, menu, s, strike and u
With which tags can I replace those old tags?

2)  I need an <br> after an <li>. How can I use this without getting an warning?

3) What does this error mean?
   "Cannot recover after last error. Any further errors will be ignored."



Thank you
Avatar of Scott Fell
Scott Fell
Flag of United States of America image

Can you post sample html or a link to your site? Otherwise the specs are on w3.org.

Instead of a br after your li, use css to add space. Line height, padding, margins are an option.

For the last error it just means it stopped looking for more errors because there were too many previous errors.
Note: Post your URL for best answers.

1) I am using old  html-tags: applet, basefont, center, align, dir, font, isindex, menu, s, strike and u
With which tags can I replace those old tags?

One good way to approach this is to search for html5 replace then your tag, like...

Search: html5 replace isindex

Each tag will have a unique approach for upgrading.

2)  I need an <br> after an <li>. How can I use this without getting an warning?

Just guessing...

<li>
Some text<br>some more text<br>more text<b>last text.
</li>

Open in new window


Keep in mind <li> is a block level tag + <br> is an inline tag, so <br> can't standalone.

Said another way, a <br> tag may only only occur within a block tag to be correct syntax + parse correctly in all browsers.

So you can never have a <br> tag after an <li> tag. The <br> tag must occur inside an <li> + </li> enclosure.

3) What does this error mean?
   "Cannot recover after last error. Any further errors will be ignored."

Exactly what it said.

You have so many errors, the parser gave up (could not recover).

This means no way to guess how your page will render in any browser.

4) For best upgrades change over to an HTML5 doctype, so your files will take a form similar to...

<!DOCTYPE html>

<html lang="en">

<head>

 <meta charset="UTF-8">

</head>

<body>
... ... ...
</body>

</html>

Open in new window

You may find this reference useful:
https://www.w3schools.com/tags/default.asp
It is a alphabetically arranged list of tags in which the ones highlighted in red are not supported by HTML5.  It will tell you whether to use CSS or an alternative attribute / object / tag, and if you click on the link it will provide you with alternative examples.
Hi,

I would not take the time to validate old website.
I would redo the entire website using HTML5 and using Bootstrap so the website adjust to smaller devices.

Once you finish the new website then validate it.

You will find a lot of free course on HTML5, CSS and Bootstrap 4 on https://www.udemy.com
This will help you to prevent validation issue and get more up to date code tag and syntax.
Avatar of Software Software

ASKER

I still don't know how to fix this error?

Element br not allowed as child of element ul in this context. (Suppressing further errors from this subtree.)

Open in new window


</li>↩		<br>↩		<li

Open in new window

To correctly answer the question, "Element br not allowed as child of element ul in this context. (Suppressing further errors from this subtree.)"

You must provide a link to your actual HTML page or look at your validator output + fix per my comments above.

Without seeing your entire document, people have to guess.

If you provide your document URL, you'll have correct (non-guess) answers.
Hi,

You need to put some padding-top to the <li> that will simulate the space of a <br> between 2 <li>

See this example
http://jsfiddle.net/lenamtl/vnt8awqu/
I still don't know how to fix this error?
You need to put some padding-top to the <li> that will simulate the space
Yes, that was the very first comment here.

What suggestions  here have you tried already?
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.