Add Images to your Website- doesn't work why?

Add Images to your Website- doesn't work why?
0.0 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>
  .red-text {
    color: red;
  }

  h2 {
    font-family: Lobster, Monospace;
  }

  p {
    font-size: 16px;
    font-family: Monospace;
  }
</style>

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

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

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

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36.

Link to the challenge:


#2

The challenge has a bug, which makes it not accept hyphenated alt text. Changing the - to a space should fix it, although "relax cat" is not a good alt text.


#3

This stays unchecked: “your image element must have an alt attribute”, and I don’t know how to do that. I need help please


#4

Have you solved it yet? Could you share your code?


#5

You basically have an alt attribute on your page already, but you placed your alt attribute outside of your actual <img> tag.

Instead of (your example):

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

Try with:

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

When you are working with an attribute, it should always be specified in the start of the HTML tag. The page doesn’t read your alt-text when it is outside of the actual tag.


#6

No @kevcomedia, I haven’t solved it yet… I’m still trying to


#7

Thanks @AlexakaCardi I’ll try it again