HTML Guides for new line
Learn how to identify and fix common HTML validation errors flagged by the W3C Validator — so your pages are standards-compliant and render correctly across every browser. Also check our Accessibility Guides.
To fix the issue of having a bad value for the src attribute on an img element due to having a tab, new line, or carriage return, you need to ensure that the src attribute does not contain any additional whitespace characters like tab, new line, or carriage return.
Incorrect code:
<img src="images/example.jpg
" alt="Example Image">
Corrected code:
<img src="images/example.jpg" alt="Example Image">
By removing the extra whitespace characters (new line in this case) and ensuring that the src attribute value is properly enclosed within quotes, the issue should be resolved.
Ready to validate your sites?
Start your free trial today.