question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

img element - confusing test output

See original GitHub issue

Affected page

https://www.freecodecamp.org/learn/responsive-web-design/basic-html-and-html5/add-images-to-your-website

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:closed
  • Created a year ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
raisedadeadcommented, May 13, 2022

What @ShaunSHamilton said:

I am in favour of allowing valid HTML to pass. That is, change the test to be case-insensitive.

1reaction
ShaunSHamiltoncommented, Apr 24, 2022

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found