Learnerslesson
   JAVA   
  SPRING  
  SPRINGBOOT  
 HIBERNATE 
  HADOOP  
   HIVE   
   ALGORITHMS   
   PYTHON   
   GO   
   KOTLIN   
   C#   
   RUBY   
   C++   
   HTML   
   CSS   
   JAVA SCRIPT   
   JQUERY   




HTML - Comments


We have already seen that HTML code you write gets converted into an interactive page in a website.


Example :



<html>
	<body>
        <p>Hello World</p>
	</body>
</html>


Output :




However, there are scenarios where you want to write a piece of text or comments in HTML and not get it rendered in a webpage. It is possible using <!-- -->.


Whatever you write inside <!-- and --> doesn't get displayed in the webpage.


Example :



<html>
	<body>
		<!-- This text doesn't get displayed in the webpage -->
        <p>Hello World</p>
	</body>
</html>


Output :




So, as you can see in the above example, the text This text doesn't get displayed in the webpage doesn't get displayed in the webpage. Because it is inside <!-- and -->.


<!-- This text doesn't get displayed in the webpage -->

And this is how you can write comments that doesn't get displayed in the webpage.