img element - confusing test output
See original GitHub issueAffected page
Your code
<h2>CatPhotoApp</h2>
<main>
<IMG src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="relaxing cat with orege fur">
<p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p>Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
</main>
Expected behavior
Somewhat confusingly, this code passes the first test but fails the third test. It isn’t immediately obvious to me why the capitalization doesn’t seem to matter to the first test but does to the third. Changing the IMG
to img
gets this code passing, but that isn’t obvious from the error message of “Your image element’s alt
attribute should not be empty.”
Issue Analytics
- State:
- Created a year ago
- Comments:8 (7 by maintainers)
Top Results From Across the Web
<img>: The Image Embed element - HTML - MDN Web Docs
When an alt attribute is not present on an image, some screen readers may announce the image's file name instead. This can be...
Read more >How to test if an img tag points to an existing image?
You can use Capybara's finder methods to find the img tag in question, ... But if you print it out first in a...
Read more >Image has non-empty accessible name | ACT Rule | WAI - W3C
Description. This rule checks that each image either has a non-empty accessible name or is marked up as decorative. Applicability.
Read more >DEPRECATED — Image filename is accessible name for image
This rule checks that image elements that use their source filename as their accessible name do so without loss of information to the...
Read more >Tribute Page Project (Help me out) - HTML-CSS
When you run your tests, you should see some output indicating what's wrong. For example, you have a failure on “ 3.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
What @ShaunSHamilton said:
@Sboonny An issue with the help wanted or first timers only label is open for contribution. The first comprehensive PR created will be reviewed and merged. We typically do not assign issues to anyone other than long-time contributors.
If you would like to contribute, and have not read the contributors docs, please do so here: https://contribute.freecodecamp.org/#/
If you have any issues with contributing, be sure to join us on the contributors channel, or on the contributors sub-forum
I am in favour of allowing valid HTML to pass. That is, change the test to be case-insensitive.