"Create a class called smaller-image and use it to resize the image so that it’s only 100 pixels wide."
img { width: 100px; }"Your img element should have the class smaller-image."
"Create a class called smaller-image and use it to resize the image so that it’s only 100 pixels wide."
img { width: 100px; }"Your img element should have the class smaller-image."
Writing an actual question helps a lot
You’re missing a class name.
in this case your CSS is changing the width of the image by targeting the img
html item…
you want to do something akin to what you did in earlier exercises where you changed font colours but user classes like .pink-text
etc…
Instead of using img tag make a requested class .smaller-image and add it to image himself …
If you see the left side of your screenshot, it says to create a class called smaller-image,
In your code you have created class called red-text, similar to that create a class with smaller-image as class name
And instead of
img { }
in your styling part, you have to reference that class name (smaller-image)
Maybe applying the class to the img element? <img class="smaller-image" src...
In the last screenshot, both tests fail because previously you were applying the correct size to the img element, and when you changed “img” to “.smaller-image”, not a single element is getting the size applied to because there is no html element with the specified class name. The challenge is asking you to be specific and target an img with a class name of “smaller-image”, so the code I mentioned in the first paragraph should work.
This what I have from the Basic CSS: Size Your Images challenge. What do I need to change in order to past this challenge?
.red-text { color: red; }h2 {
font-family: Lobster, monospace;
}
Click here to view more cat photos.
Things cats love:
Top 3 things cats hate:
Very correct man, it worked