How To Comment Out HTML

Hey everyone, to day post most common and popular question is.  Comment Out HTML ? Sometimes you’ve got something coded in your webpage and you don’t want it to show for a limited amount of time. You want to make some comments about what it is or why it’s important or how it works. I mean you can basically just add comments to anything you can just add something like this in your HTML. To say whatever is here and then you could basically duplicate the same thing at the end to say hey everything.

That’s in between this is related to whatever so whatever ends here let’s just say you have like in this case we’ve got a bulleted. List here showing this is a start of the bulleted list starts with UL ends with UL but let’s say for whatever reason. I did not want this bulleted list to show I didn’t this is a table of contents. I’m just pulling this from the WordPress codex but let’s just say I didn’t want this table of contents to show on my page.

Comment adding Before: 

<!DOCTYPE html>
<html lang=”en” dir=”ltr”>
<head>
<meta charset=”utf-8″>
<title>How To Comment Out HTML</title>
</head>
<body>

<!– Don’t show this right now–>
<ul>
<li class=”btn info”<a href=”example.com”>Link</a>
<li class=”btn info”<a href=”example.com”>Link</a>
<li class=”btn info”<a href=”example.com”>Link</a>
<li class=”btn info”<a href=”example.com”>Link</a>
</ul>

</body>
</html>

 

 

I also didn’t want this code to load what I could do is just inside of this code. I’m gonna copy and paste it into a notepad file just. I can show you how to do this but inside of here let’s just say I’m gonna copy that paste it into here what you could do. Say hey I’m not going to show this right now, so I’m just gonna put this part at the beginning. Say whatever here you don’t show this right now and then I leave that comment open and then at the end and put a thing down here at the bottom. That says that’s where it should stop so basically I’m saying everything that comes in between this little part at the beginning and this part. At the end should not show on the page this is all basically a comment but again you can start and end.

Comment adding After: 

<!DOCTYPE html>
<html lang=”en” dir=”ltr”>
<head>
<meta charset=”utf-8″>
<title>How To Comment Out HTML</title>
</head>
<body>

<!– Don’t show this right now
<ul>
<li class=”btn info”<a href=”example.com”>Link</a>
<li class=”btn info”<a href=”example.com”>Link</a>
<li class=”btn info”<a href=”example.com”>Link</a>
<li class=”btn info”<a href=”example.com”>Link</a>
</ul>
–>

</body>
</html>

If you just want to make some notes about what’s in between the code you can start and end it that way or you can just say hey. I don’t want to show this and I want to walk it out here at the end so everything that shows up. In between that comment or as part of that comment in HTML is not going to show on the web page because it exists inside of the comment.

Leave a Reply

Your email address will not be published. Required fields are marked *


TechinfoHQ © 2019