[BUG] - Basic CSS: Size Your Image accepts second image element
See original GitHub issueDescribe your problem and how to reproduce it:
This particular challenge will pass the tests with a second image element under specific conditions:
- The second image element must also reference the same cat photo url
- The second image element must come before the first
This code will pass the tests:
<style>
.red-text {
color: red;
}
h2 {
font-family: Lobster, monospace;
}
p {
font-size: 16px;
font-family: monospace;
}
.smaller-image {
width: 100px;
}
</style>
<h2 class="red-text">CatPhotoApp</h2>
<main>
<p class="red-text">Click here to view more <a href="#">cat photos</a>.</p>
<img src="https://bit.ly/fcc-relaxing-cat" class="smaller-image">
<a href="#"><img src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back."></a>
This is a bit of a convoluted edge case, so I am not sure if it warrants a fix or not.
I believe it could be fixed by adding a test (or expanding the existing tests) to assert that $('img').length
returns 1.
Related forum post: https://forum.freecodecamp.org/t/change-the-size-double-photo/432740
Add a Link to the page with the problem:
https://www.freecodecamp.org/learn/responsive-web-design/basic-css/size-your-images
Tell us about your browser and operating system:
- Browser Name: Chrome
- Browser Version:
- Operating System: Windows 10 v. 1909
If possible, add a screenshot here (you can drag and drop, png, jpg, gif, etc. in this box):
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Basic CSS: Size Your Images | freeCodeCamp - YouTube
Today we learn how to use basic CSS to size your images. This is another video in a series in which we teach...
Read more >Size Your Images Basic CSS via FreeCodeCamp Org - YouTube
FOLLOW ALONG LINK: https://www.freecodecamp.org/learn/responsive-web-design/ basic - css / size - your -imagesCheck out the FreeCodeCamp.org Courses ...
Read more ><img>: The Image Embed element - HTML - MDN Web Docs
The HTML element embeds an image into the document. ... intrinsic size of the image (the image's display size if no CSS styling...
Read more >Changing image sizes proportionally using CSS
This is a known problem with CSS resizing. Unless all images have the same proportion, you have no way to do this via...
Read more >[SOLVED] Size Your Images Error - HTML-CSS
Hello guys. The site finds this error: Your img element should have the class smaller-image. But I've put a class=“smaller-image” to my img ......
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
@nhcarrigan You had responded to the user that nothing had been concluded. We can close this issue and then reference our decision to close this issue in that PR (and close it too).
I do not think we should make any change here. It is an odd edge case, to say the least.
The lesson is about adding a class. If the camper has added the class to one image, then they have accomplished the learning outcome.
If something has to change, I would vote for:
⬆️ Added the word
existing
(I realise it is implied, but some do miss it)