Unsure what i am missing here please help

Tell us what’s happening:
Describe your issue in detail here.

  **Your code so far**
<style>
.responsive-img {
img {
max-width: 100%;
display: block;
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/102.0.0.0 Safari/537.36

Challenge: Make an Image Responsive

Link to the challenge:

Hello @hblickenstaff ,

First you should a CSS selector named responsive-img. How to do that? →

css selector {
property: value;
}

What is a CSS selector? Let’s say i want to style all my p elements inside my document, i can write a code like this.

p {
color: red;
}

--> p is the CSS selector.
--> color is the property.
--> red is the value.

This will change the all p elements’ text color to red innside my page.

Direct solution to your problem →

<style>

.responsive-img {  --> CSS selector is a class name here which we defined inside the <img> tag

max-width: 100%;

display: block;

height: auto;

}

</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">

thank you for your response and help it is greatly appreciated

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.