Can't make it work individually from fcc

Can't make it work individually from fcc
0

#1

Hello everyone,

Everything goes fine with learn.fcc.com, but when I create a new html document with TextEditor, paste the exact Cat-Photo-App code and open it with Safari, the only thing I see is the code, not a web page. It doesn’t seem as when it’s on learn.fcc.com.

Would someone please explain why this occurs? Thanks everyone.

This is the code I wrote on TextEditor:

<!DOCTYPE html>
<html>
<h2>CatPhotoApp</h2>
<main>
  <p>Click here to view more <a href="#">cat photos</a>.</p>
  
  <a href="#"><img src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back."></a>
  
  <p>Things cats love:</p>
  <ul>
    <li>cat nip</li>
    <li>laser pointers</li>
    <li>lasagna</li>
  </ul>
  <p>Top 3 things cats hate:</p>
  <ol>
    <li>flea treatment</li>
    <li>thunder</li>
    <li>other cats</li>
  </ol>
  <form action="/submit-cat-photo">
    <input type="text" placeholder="cat photo URL" required>
    <button type="submit">Submit</button>
  </form>
</main>
</html>

#2

Hey Berke,
You do not have body tag in your code.
You need to have body tag to run your code.
Hope it helps.


#4

Hey aditya_p,
Thanks a lot for your help, but it still doesn’t seem to be working
The last code I tried:

<!DOCTYPE html>
<html>
<head><title></title></head>
<body>
<h2>CatPhotoApp</h2>
<main>
  <p>Click here to view more <a href="#">cat photos</a>.</p>
  
  <a href="#"><img src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back."></a>
  
  <p>Things cats love:</p>
  <ul>
    <li>cat nip</li>
    <li>laser pointers</li>
    <li>lasagna</li>
  </ul>
  <p>Top 3 things cats hate:</p>
  <ol>
    <li>flea treatment</li>
    <li>thunder</li>
    <li>other cats</li>
  </ol>
  <form action="/submit-cat-photo">
    <input type="text" placeholder="cat photo URL" required>
    <button type="submit">Submit</button>
  </form>
</main>
</body>
</html>

#6

What is the extension of the file that you open with your browser?
It might be possible you are not using proper file name


#7

It is .html. I have just checked it again.


#8

Your code seems to work in my editor.
Try changing the browser.


#9

I changed some format and saving settings and it’s fixed. As you said, it’s about the file type.
Thanks a lot.

If someone else would have the same problem, here’s a link that might be helpful: https://www.w3schools.com/Html/html_editors.asp


#10

Congrats man.
Keep going.
Cheers.