My code is not working even though I tried everything possible . Please help me out in this challenge

Tell us what’s happening:

Your code so far


<h2>CatPhotoApp</h2>
<main>
<img src="https://bit.1y/fcc-relaxing-cat.jpg"alt=relaxing cat" >

<p>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>Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
</main>

Your browser information:

User Agent is: Mozilla/5.0 (Linux; Android 5.1.1; SM-J200G) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.117 Mobile Safari/537.36.

Challenge: Add Images to Your Website

Link to the challenge:

Hi @Aditya21 welcome to FCC. your code has a number of issues.

  1. Value of alt attribute should be in quotes i.e. alt="relaxing cat"
  2. Remove the .jpg extension in the src attribute.
  3. The value of src attribute is https://bit.ly/fcc-relaxing-cat what you have has the number 1 in bit.1y. It should be l(letter l)
1 Like

@nibble why i can’t give the extension (.jpg) to my image. In the src attribute they said to give the name of my image as well as where they located in…

The instruction says :

  1. Now set the src attribute so that it points to this url:https://bit.ly/fcc-relaxing-cat
    Meaning you should have:
       src="https://bit.ly/fcc-relaxing-cat"
    
  2. Finally, don’t forget to give your img element an alt attribute with applicable text.

Meaning you should add alt = "relaxing cat" to the code above so that you get:

<img src="https://bit.ly/fcc-relaxing-cat" alt= "relaxing cat" >

NOTE alt attribute value can be an appropriate text.

1 Like

@nibble forget about what the instruction has said, let’s try to gain some basic…
<img src='myImage.jpg' alt=''>
this code will work. am I right or wrong?
so what’s the problem with the challenges code, I mean .jpg extension?
what’s the reason for not putting the .jpg extension in the following code ?
and last thanks for giving the time :slight_smile:

The url https://bit.ly/FCC-relaxing-cat is a tiny url that gets expanded to a full url that ends in .jpg. But you need to type in the url as instructed. There are cases in programming where an input or variable needs to be character for character correct.