All TalkersCode Topics

Follow TalkersCode On Social Media

HTML Comment Multiple Lines

Last Updated : Jul 1, 2023

HTML Comment Multiple Lines

In this tutorial we will show you the solution of HTML comment multiple lines, in HTML you write code for a website and sometimes when you want to change something in your website, then there a situation occurs where you don’t know, where in the html codes you have to make change.

And there is also a condition when you share your html file to some others then him unable to read your code that what is done in how many lines of code.

Then this time you have to use comments in your html code. Let us understand what comments are and how we have to use them.

Step By Step Guide On HTML Comment Multiple Lines :-

As, now you know that why the comments are used. Now, let us understand what comments are.

Comments may be a single line or may be multiple lines in html code.

These are used to show others that what happens in this line and what goes happens in next several lines of html code.

Actually, the fact behind comments is that the comments are not showed on browser when you open html code on browser.

But these are seen from coding. Today, we will show you that how you are able to make multiple lines comment in html.

 <!DOCTYPE html>
 <html lang="en">
 <meta charset="UTF-8">
 <meta http-equiv="X-UA-Compatible" content="IE=edge">
 <meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Multiline comment means
The comment in not end in one line
You are able to make several lines of comment one time.
This line and above text is not
showed on browser screen and appears with different color on you ide. -->
        you can also make single line comment
        this single line comment topic is already defined in previous session.
  1. First, we write <! DOCTYPE html> which we used as an instruction to the web browser about what version of HTML file is written in.
  2. Secondly, the <html> tag is used to indicate the beginning of an HTML document.
  3. As above now <head> tag is used to contain information about web page. In this tag a <title> tag is used which helps us to specify a webpage title. Both <head> and <title> tags are Paired tags. So, both have </head> and </title> ending tags respectively.
  4. Thirdly, <body> tag is used to define the webpage body. All the contents to show on website are written here.
  5. Hence, when you run this code, you see only text between headings on browser screen.
  6. You can make any line comment by using <! -- -->, these tag are used to make a multiline comments in html and also can be used to make single line comments.
  7. You can also make a tag with content as comment for later use by using same tags that are <!—and -->. Whereas <!—is opening tag and --> is closing tag.
  8. At last, the <body> and <html> tags are closed with </body> and </html> respectively.

Conclusion :-

At last, here we can say that with the help of this article. We are able to make multiline, in this code. I hope this tutorial on HTML comment multiple lines helps you.

Author Image About Anjali

Experienced Computer Programmer with a broad range of experience in technology. Strengths in application development and Object Oriented architecture design, front end programming, usability and multimedia technology. Expert in coding languages such as C, C++ Java, JavaScript, PHP and more.

Follow Anjali On Linkedin 🡪