Alt attribute in img not recognized
See original GitHub issueChallenge Name
Issue Description
Tests do not recognize the alt
attribute in the img
element (see code below). I think it has something to do with the hyphen? Seems to work fine with an alt
that doesn’t have it.
Browser Information
- Browser Name, Version: Chrome 61.0.3163.100
- Operating System: Windows 10
- Mobile, Desktop, or Tablet: Desktop
Your Code
<link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
.red-text {
color: red;
}
h2 {
font-family: Lobster, Monospace;
}
p {
font-size: 16px;
font-family: Monospace;
}
</style>
<h2 class="red-text">CatPhotoApp</h2>
<img src="https://bit.ly/fcc-relaxing-cat" alt="Cute upside-down kitten. ">
<p class="red-text">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 class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
Screenshot
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
HTML img, alt="" isnt working
Im using some icons on my website and in general most of the people who play this game know the icons but in...
Read more >Why an HTML image alt text doesn't show on hover
Reasons why an HTML image alt text does not show when hovering in Firefox, Chrome and does show in Internet Explorer with examples....
Read more >Img Alt Attribute Not Appearing in Sourcecode
Hi all- I inherited a site with an older theme and I've been working on getting its accessibility up to speed. I entered...
Read more >"alt" attribute not working - MSDN
Hi, I am using Windows 8.1 with IE 11 and find that the "alt" attribute in images is not displaying the text that...
Read more >HTMLImageElement.alt - Web APIs | MDN
A string which contains the alternate text to display when the image is not loaded or for use by assistive devices. The alt...
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
@thefifthisa I did some more digging because I had the same questions as you after reading your issue. It seems that alt attributes should not use hyphens, and the reason behind this is SEO i.e. someone isn’t going to do a search for ‘cat-image’, rather they’ll search ‘cat image’.
I think it should still pass the test, so you’re right, the issue may be with FCC; though, I’m not an expert and would love to hear someone else’s explanation.
@angelfeliz
Thanks for your interest in fixing. I think we do not need italicizing here.
Lets keep it like so;
That said, you would also have to work on the tests that are failing for special chars.
Happy coding!