Help me please... Been doing this for 90 mins

A business cat wearing a tie.
My teacher bot is telling me the alt can not be empty. Looks full to me. What is going on?

   **Your code so far**

<h2>CatPhotoApp</h2>
<main>
<img src=https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg>
<alt> A business cat wearing a tie.
<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 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36

Challenge: Add Images to Your Website

Link to the challenge:

You tried to make an <alt> element. But alt is not an element, it’s an attribute that belong inside the img tag. Check the example again.

1 Like

So your saying just remove <> around the alt?
I have it like that now and no dice.

<img src="..." alt="...">

1 Like

you are missing double quata and alt attribute

example :


<img src="your image path" alt="any alternative text you want" title="optional anything you wnat">

you have given alt attribute outside your img tag
first of all let me clear here,

alt means alternative text, which is used whenever your image is not shown , reason can be anything like url moved or wrong, can be anything then your alternavitve text will show insted of image {alt} . thats the use of alt attribute .

title = > is used for showing additional information when someone hover over your image then it will show some information to your user.
for example take your mouse over below image and see it will show some information about image

laptop

<img src="https://images.unsplash.com/photo-1525547719571-a2d4ac8945e2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxzZWFyY2h8NHx8bGFwdG9wfGVufDB8fDB8fA%3D%3D&auto=format&fit=crop&w=500&q=60" alt="laptop" title="A beautiful laptop" height="200px" width="200px">

code of above image

img src= https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg
alt=A business cat in a bowtie.

? same error

you are missing => " " before and after url

syntax is

<img src="url" alt="alternative text" title="optional" >

<img src= https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg alt=A business cat in a bowtie.

I missed the< in the copy and paste. But I had it the whole time. Your example looks like my code. There must be something I am not seeing…?

Do you see it? Or is this thing broken or are my eyes?

you are missing => " "

example :

src=“your image path”

@M.Will, Post all of your current code, not just one line.

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 (’).

alt is not an HTML element you are not suppos to create alt like that “alt” reffers to if any how your image is not loading or image is broken then what it should render on screen like “test image” now can see in image is broken or no found it is rendering test image .

[quote=“M.Will, post:8, topic:489930”]
<img src= https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg alt=>A business cat in a bowtie.>

I’ve tried >
both after the alt= and after the bowtie. Neither worked.
I tried both at the same time and one at a time.

Hang in there with me. I can’t quit until i figure this out.

<img src=https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg alt=>A business cat in a bowtie.

CatPhotoApp

A business cat in a bowtie.

Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.

Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.

@M.Will, please post all of your current code. See my previous post on how to format.

On a side note, take a look at the sample code in the lesson to see how it’s formatted. As has been said multiple times, you are missing quotation marks.

1 Like

Thanks. Quotation marks! Got it.
First day on this coding stuff. The language is not intuitive.
I appreciate your help and simplicity.

I think you just need to put a quotation mark and you don’t need the <>
alt="A business cat wearing a tie."

Hope this helps!

Thanks
That was the trick
Merry Christmas

@M.Will Merry Christmas to you too! :christmas_tree: