Commenting in html5

Tell us what’s happening:

I do not seem to get how to comment in html

Your code so far


<!-- <h1>Comment  header--> <!--<p>comment subtle --> <!-- <article>I am the text of the comment</article> -->
<h1>Hello World</h1>

<h2>CatPhotoApp</h2>

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

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.1; ) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36.

Challenge: Comment out HTML

Link to the challenge:

That top line is three comments. What problems are you having?

I just started the learning the basics on html and I do not seem to get how to comment out in the exercise given.

To start a comment use <!--
To end a comment use -->

<!-- comment out any thing 
dsjfkjd f
more lines of comment
it stops when I put -->
now this is code 
fake code but still code
<!-- here is a comment that never ends  because it doesn't have the end arrow...
.
.
.

-Justin :vulcan_salute:

1 Like

I have done that but when I run the test it keeps telling me that
" Your h1 element should be commented out so that it is not visible on the page" and " Your p element should be commented out so that it is not visible on the page"

Look at the web page. Can you still see the words Hello World and Kitty ipsum dolor....

Well then that means you’re doing something wrong. Because as you said

If I don’t want to see the h1 element I need to comment it out which you aren’t doing.

If you want to comment out the h1 element you need to do something else.

Here’s a hint if you get stuck.

/* The line below is the start of a comment
<!--
/* don't edit the code under this line */
<h1> Hello World </h1>
/* don't edit the code above this line */

/* on the live above you need to finish commenting out the h1 element */

What you’ve done is comment out “a” <p> and <h1> tag in the first line. The challenge wants you to comment out the provided <p> and <h1> tags so that the only html that runs is the <h2> tag.

What you have

<!-- <h1>Comment  header--> <!--<p>comment subtle --> <!-- <article>I am the text of the comment</article> -->
<h1>Hello World</h1>

<h2>CatPhotoApp</h2>

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

What you should have

<!--
<h1>Hello World</h1>
-->
<h2>CatPhotoApp</h2>
<!--
<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>
-->

-Justin :vulcan_salute:

Thank you very much :smiley:

No problem, I just hope you fully understand it now.
:vulcan_salute:

Yes I understand it now.