Tell us what’s happening:
Your code so far
<style>
.responsive-img
img {
max-width: 100%;
height: auto;
}
img {
width: 600px;
}
</style>
<img class="responsive-img" src="https://s3.amazonaws.com/freecodecamp/FCCStickerPack.jpg" alt="freeCodeCamp stickers set">
<img src="https://s3.amazonaws.com/freecodecamp/FCCStickerPack.jpg" alt="freeCodeCamp stickers set">
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36
.
Challenge: Make an Image Responsive
Link to the challenge:
Learn to code. Build projects. Earn certifications.Since 2015, 40,000 graduates have gotten jobs at tech companies including Google, Apple, Amazon, and Microsoft.
This is your selector:
.responsive-img
img {
max-width: 100%;
height: auto;
}
What the .responsive-img img
selector means in plain English is "Select the image elements (img
) which are inside another element with a class of .responsive-img
So for this to work, it would have to look like this:
<div class="responsive-img">
<img src="https://image.com/img.jpg">
</div>
But what you have in your code is an image with the class of .responsive-img . In order to select this, the correct selector would be
img.responsive-img {
max-width: 100%;
height: auto;
}
Which, in plain English, means "Select all the images with a class of responsive-img
"
With warm regards,
Onur Bal
i have got this solution by this code
responsive-img {
max-width: 100px;
height: auto;
}
thanks for your response sir