Sunday 15 October 2017

Remark is a bit of code which is disregarded by any web program. It is a decent practice to include remarks into your HTML code, particularly in complex archives, to demonstrate areas of a report, and some other notes to anybody taking a gander at the code. Remarks enable you and others to comprehend your code and builds code clarity.

HTML remarks are put in the middle of <!- - ... - > labels. Thus, any substance set with-in <!- - ... - > labels will be dealt with as remark and will be totally overlooked by the program.

Case 

<!DOCTYPE html>
<html>

   <head>  <!-- Document Header Starts -->
      <title>This is document title</title>
   </head> <!-- Document Header Ends -->
	
   <body>
      <p>Document content goes here.....</p>
   </body>
	
</html>
Legitimate versus Invalid Comments 

Remarks don't settle which implies a remark can't be put inside another remark. Second the twofold dash grouping "- - " may not show up inside a remark with the exception of as a major aspect of the end - > tag. You should likewise ensure that there are no spaces in the begin of remark string.

Illustration 

Here, the given remark is a substantial remark and will be wiped off by the program.

<!DOCTYPE html>
<html>

   <head>
      <title>Valid Comment Example</title>
   </head>
	
   <body>
      <!--   This is valid comment -->
      <p>Document content goes here.....</p>
   </body>
	
</html>

In any case, following line isn't a substantial remark and will be shown by the program. This is on the grounds that there is a space between the left edge section and the outcry check.

<!DOCTYPE html>
<html>

   <head>  
      <title>Invalid Comment Example</title>
   </head>
	
   <body>
      < !--   This is not a valid comment -->
      <p>Document content goes here.....</p>
   </body>
	
</html>

Multiline Comments 

So far we have seen single line remarks, yet HTML bolsters multi-line remarks too.

You can remark different lines by the uncommon starting tag <!- - and finishing tag - > put before the principal line and end of the last line as appeared in the given case beneath.

Illustration 

<!DOCTYPE html>
<html>

   <head>  
      <title>Multiline Comments</title>
   </head> 
	
   <body>
      <!-- 
         This is a multiline comment and it can
         span through as many as lines you like.
      -->
      
      <p>Document content goes here.....</p>
   </body>
	
</html>

Contingent Comments 

Contingent remarks just work in Internet Explorer (IE) on Windows however they are overlooked by different programs. They are bolstered from Explorer 5 onwards, and you can utilize them to give contingent guidelines to various variants of IE.

Case 

<!DOCTYPE html>
<html>

   <head>  
      <title>Conditional Comments</title>

      <!--[if IE 6]>
         Special instructions for IE 6 here
      <![endif]-->
   </head> 
   
   <body>
      <p>Document content goes here.....</p>
   </body>
	
</html>
You will go over a circumstance where you should apply an alternate template in light of various variants of Internet Explorer, in such circumstance contingent remarks will be useful.

Utilizing Comment Tag 

There are couple of programs that help <comment> tag to remark a piece of HTML code.

Note − The <comment> tag deplored in HTML5. Try not to utilize this component.

Case 

<!DOCTYPE html>
<html>

   <head>
      <title>Using Comment Tag</title>
   </head>
	
   <body>
      <p>This is <comment>not</comment> Internet Explorer.</p>
   </body>
	
</html>

Remarking Script Code 

In spite of the fact that you will learn JavaScript with HTML, in a different instructional exercise, however here you should make a note that in the event that you are utilizing Java Script or VB Script in your HTML code then it is prescribed to put that content code inside appropriate HTML remarks so old programs can work legitimately.

Illustration 

<!DOCTYPE html>
<html>

   <head>
      <title>Commenting Script Code</title>
      
      <script>
         <!-- 
            document.write("Hello World!")
         //-->
      </script>
   </head>
	
   <body>
      <p>Hello , World!</p>
   </body>
	
</html>

Remarking Style Sheets 

In spite of the fact that you will get the hang of utilizing templates with HTML in a different instructional exercise, however here you should make a note that in the event that you are utilizing Cascading Style Sheet (CSS) in your HTML code then it is prescribed to put that template code inside legitimate HTML remarks so old programs can work appropriately.

Case 

<!DOCTYPE html>
<html>

   <head>
      <title>Commenting Style Sheets</title>
      
      <style>
         <!--
            .example {
               border:1px solid #4a7d49;
            }
         //-->
      </style>
   </head>
	
   <body>
      <div class = "example">Hello , World!</div>
   </body>
	
</html>

0 comments:

Translate

GoogleTech786. Powered by Blogger.

Subscribe Youtube

Our Facebook Page

Wikipedia

Search results

Popular Posts

Adsense