Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

W3C Validation Failed, Illegal character in path segment: space is not allowed

<img src="webpage photos/alcazar.jpg" alt="Alcazar Palace">

The error shown by validator: Bad value webpage photos/alcazar.jpg for attribute src on element img: Illegal character in path segment: space is not allowed.

As soon as I remove the spaces I try to replace them by hyphens or %20 as recommended by some online I get even more errors but the webpage functions.

What seems to be the problem here?

Thank you

like image 503
Dravenzo Avatar asked Sep 06 '25 19:09

Dravenzo


1 Answers

The white space is not allowed in urls, you need to replace it with %20

As soon as I remove the spaces I try to replace them by hyphens or %20 as recommended by some online I get even more errors

well the W3C validation service will complain about the absence of doctype declaration and the title element and the lang attribute

so when you check with more code

<!DOCTYPE html>
<html lang="en-us">
<head>
  <title>Some title</title>
</head>
<body>
  <img src="webpage%20photos/alcazar.jpg" alt="Alcazar Palace">
</body>
</html>

you get Document checking completed. No errors or warnings to show.

like image 158
Saadi Toumi Fouad Avatar answered Sep 08 '25 10:09

Saadi Toumi Fouad