Help me with setting image's width

Ex.:

then use Ctrl + v

wow,thank u,but pls i dont understand what u tapped to get those option,pls can u enlighten me,ur project is nice

Right-mouse click on project, select copy link adress, go on forum, and again Right-mouse click and select paste (or Ctrl+v)

ok thank u so so much

If you have a question about a specific challenge as it relates to your written code for that challenge, just click the Ask for Help button located on the challenge. It will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.

Thank you.

When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).

nothing is working. it still saying my img element should have class even after this code: img class=“smaller-image” src="https://www.example.com/pictures/>

Hello @blessedonyi,

Can you give us the link of the challenge or your project for that we can check what is happening? It is difficult to understand without it. If it is a challenge, the URL of your src attribute look really different from what freeCodeCamp is asking to use usually. If it is about a project, it would be great that we can have the error message in the logs.

@LucLH, Its a challenge, I wasn’t given any URL. I was only told to create an image class called smaller-image and resize it to 100px. I did it like this:

.smaller-image { width: 100px }

It did not work then I had to use src to see if it will work

the url that point to the challenge, the one in the browser address bar

Ok, then can you give us the link of the challenge to do tests? We don’t have to go to search every challenges to see which one you are talking about to help you. Also, as I told you with the code you gave us, the url you are using for your src attribute doesn’t look at all as the url shape of the freeCodeCamp challenges. Try to verify this.

I think that is the link for lesson

1 Like

Thanks @stefan2007octavian,

So @blessedonyi, if it is this challenge, look the original <img> tag code:

<img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back.">

Yours:

img class=“smaller-image” src="https://www.example.com/pictures/ 2>

If we analyse your code, there are few issues. I advice you to read again the course to understand them. Little hints:

  • Look how you open your img tag
  • Compare the type quotes you are using because it can bring issues in freeCodeCamp, and you have two types. The one of the src attribute is the good one
class=“smaller-image”
src="https://www.example.com/pictures/ 2
  • Look if you put all the quotes, such as in the src atrribute
  • Look the exercice, the original code, and see which url are you using

Hope it helps.

ur img doesnt have a tag before it,also i told u to try placing the class after the src,it worked for me

From what you’ve told us so far:

  1. You must’n change the <img>, you must just add the class smaller-image (so you mustn’t change url, or delete opening tag < )

  2. You must write .smaller-img within your <style> </style> elements

The order of the attributes in a HTML tag doesn’t really matter. Here the issue is that he seemed to updated some parts of the code, as I explained in my last post here. His syntax is really messy, and it is this he needs to look for.

@LucLH, stefan2007octavian, idayatademefun2003; thanks guys. your lesson really put my work inorder. I was doing one thing while thinking something else. you can truly make a great team guys.

We wrote so many answers just because we didn’t know what you meant … I mean you asked a question in another topic, without giving us a code, a link or something …

then I understood my mistake after digesting what you all said.

u are welcome.Keep coding :slight_smile: