Question

I was testing my site on W3C validator when I found some errors like:

"id" must be a single token

I've been wondering what's the fix but couldn't get an answer so if u can fix that would be appreciated.

Here's the code that gives me the error:

<form action='' id='contact form'>
Was it helpful?

Solution

It means that id should look like this:

<form action='' id='contact_form'>

E. g. without any whitespaces in value of id attribute. Also, it should be unique.

You haven't specified whether you are validating your document against HTML4 or HTML5. And there are some differences in specs for id in HTML4 and HTML5 - you can read about both here:

HTML 5:

HTML 4.0:

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top