Final answer:
Spaces should be avoided in web filenames because they can cause errors and inconsistencies when accessing the files. Use hyphens or underscores instead for easier readability and compatibility with web browsers.
Step-by-step explanation:
Spaces should be avoided in web filenames because they can cause errors and inconsistencies when a user tries to access the files. When a space is included in a filename, it is usually interpreted as a delimiter or a special character, which can confuse web servers and browsers. For example, if a file is named "my document.html" and a user tries to access it through a web browser, the browser may interpret the space as %20 and display an error or fail to find the file.
To avoid this, it is recommended to use hyphens or underscores instead of spaces when naming web files. These characters are generally accepted and easy to read. For example, "my-document.html" or "my_document.html" are valid filenames that will not cause issues when accessed through a web browser.
By avoiding spaces in web filenames, you ensure that your files can be accessed without any problems and maintain consistency across different platforms and browsers.