Need Help with this sizing an image with a class

Need Help with this sizing an image with a class
0

#1

Tell us what’s happening:

Your code so far

<link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  .smaller-image {
   width: 100px;
  }
 
  .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="A cute orange cat lying on its back. ">

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

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36.

Link to the challenge:


#2

You have completed one of the two things the challenge instructions state.

Create a class called smaller-image - COMPLETE

and

use it to resize the image so that it’s only 100 pixels wide. - NOT COMPLETE

You need to “use” the “smaller-image” class by using the class attribute inside the img element. For an example, you can look at how the “red-text” class was used on the h2 element below:

<h2 class="red-text">CatPhotoApp</h2>

EDIT: I changed your topic to better reflect exactly what type of help you needed.


#3

So under …

<img src="http://…

where do i add smaller image and the 100 pixels?


#4

You can put it anywhere inside the tag. So you could put it before the src="…" or after the src="…"

Just make sure there is a space between any other attribute or the element name (img). In the example of the h2 I mentioned above, it was put right after the h2 element tag name.


#5
<h2 class="red-text">CatPhotoApp</h2>

<img src='//discourse-user-assets.s3.amazonaws.com/original/3X/6/1/61a3499c5abb165be990aa0c1abd23342e60c663.jpg' alt="A cute orange cat lying on its back. ">
<img class=""
<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed..

What do i type in to define it?


#6
<h2 class="red-text">CatPhotoApp</h2>

<img class="smaller-image"
     src='//discourse-user-assets.s3.amazonaws.com/original/3X/6/1/61a3499c5abb165be990aa0c1abd23342e60c663.jpg' alt="A cute orange cat lying on it back. ">

Its not working


#7

Nevermind! I got it, thanks!


#8

Glad you got it figured out. In the future, when you enter a code block into the forum, remember to precede it with a line of three backticks and follow it with a line of three backticks to make easier to read. See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>) will also add backticks around text.