ad

Monday, December 15, 2025

CSS Comment Tag Explain

CSS Comments Tag Explain


web designing theory

CSS Comments Tag Explain 

What is CSS comment tag

 CSS comments tag is CSS is note written by a programmer to explain the code the browser not read comments  so they do not affect the program output.


. A CSS comment starts with /* and ends with */. Anything written inside these symbols is ignored by the browser and does not affect the webpage design. Comments can be written on one line or across multiple lines. They are very useful when learning CSS, fixing errors, or temporarily disabling styles without deleting the code.

CSS Comments Tag Explain

Syntax :-

/*  this is css comment  */


  •                           Start with /*
  •                           Ends with */

  •  CSS comment tag use single-line or multiple  line.
  •  CSS comment tag  use  code remember things later
  •  CSS comment tag use code temporarily disable
  •  CSS  comment tag use code easy to understand for other.

CSS Comments Tag Explain

Example 


<!DOCTYPE html>
<html>
<head>
<title> css comment tag </title>

    <style>
     p{  text-align:center;
         color:rgb(19, 47, 253);
         font-size: 20px;
     }
     /* style is comment so will not word*/
     /*
     h2{
     background-color:pink;
     }  
     */      
   

    </style>

</head>
<body>
           
       <p>Hello every one</p>
      <p >learn to programming language</p>
        <h2>HTML,CSS,PHP</h2>
    <p>https://webdesigningtheory.blogspot.com/</p>
  </body>
  </html>


CSS Comments Tag Explain

Explain Program

Step  1] 

<!DOCTYPE html>

  • This declare the document type.
  • browser that the document is written in html

Step 2 ]

<html>

  • html is the root element of the html page.
  •  Every thing inside it is part of the webpage.

Step 3]

<head>
        <title> CSS comment tag </title>


  •   <head>  section 
  •   head section contains metadata about page. not visible on the page itself.
  •  <title> tag  title section set the title of the page shows the browser tab.
Step 4]

<body>

  • Contains all visible of the webpage.
  • Everything inside <body> tag visible content of the webpage.
  • User will display/see their browser.

Step 5]

<style>
     p{  text-align:center;
         color:rgb(19, 47, 253);
         font-size: 20px;
     }
     /* style is comment so will not word*/
     /*
     h2{
     background-color:pink;
     }  
     */      
   
    </style>

    •   <P> ⇨ all paragraph tag
    • text-align:center;  ⇨  all <p> tag center the text.
    • color: rgb(19,47,253); ⇨  all paragraph tag color blue.
    • font-size:20px; ⇨  text size 

    CSS Comment 

     
    /* style is comment so will not word*/
         /*
         h2{
         background-color:pink;
         }  
         */      
       

    • this code inside a comment  tag.
    • <h2>  tag  will not work.
    • background color is not applied.
    Step 6]

    closing the Tag

     
    </style>
    </head>

    Step 7]

    <body>
               
           <p>Hello every one</p>
          <p >learn to programming language</p>
            <h2>HTML,CSS,PHP</h2>
        <p>https://webdesigningtheory.blogspot.com/</p>

    Body Section

    • body tag all contains  visible content of the webpage.
    • all <P> paragraph  tag  
    •   text center
    • text color blue
    • text font size 20px

    <h2> tag 

    • heading tag 
    •  Display a heading  
    • <h2> tag not css applied because  the <h2> tag style is commented 
    Step 8]

    closing the Tag

    </body>
    </html>

    CSS Comments Tag Explain

    Output

    web designing theory blogspot.com

    Related Post :-

    How to Use Textarea in HTML

    How to Add Border To Image in HTML

    How To Use The HTML Img Tag