TYPES OF CSS & COMMENTS

Types of CSS :
CSS is added to HTML pages to format the document according to information in the style sheet. There are three ways to insert CSS in HTML documents.
  1. Inline CSS
  2. Internal CSS
  3. External CSS
1. Inline CSS :
Inline CSS is used to apply CSS on a single line or element.
For example:
    < p style="color:blue">Hello CSS< /p >  
2. Internal CSS :
Internal CSS is used to apply CSS on a single document or page. It can affect all the elements of the page. It is written inside the style tag within head section of html.
For example:
    < style >  
        p{color:blue}  
    < /style > 
3. External CSS :
External CSS is used to apply CSS on multiple pages or all pages. Here, we write all the CSS code in a css file. Its extension must be .css for example style.css.
    p{color:blue}  
You need to link this style.css file to your html pages like this:
    < link rel="stylesheet" type="text/css" href="style.css" >  
The link tag must be used inside head section of html.


CSS Comments :


CSS comments are generally written to explain your code. It is very helpful for the users who reads your code so that they can easily understand the code.Comments are ignored by browsers. Comments are single or multiple lines statement and written within /*............*/ .
    < !DOCTYPE html >  
    < html >  
    < head >  
    < style >  
        p {  
        color: blue;  
            /* This is a single-line comment */  
        text-align: center;  
        }   
        /* This is a 
        multi-line  
        comment */  
    < /style >  
    < /head >  
    < body >  
        < p >Hello TesDBAcademy< /p >  
        < p >This is paragraph tag...< /p >  
        < p >Basically CSS comments are ignored by the browsers and not displayed in output...< /p >
    < /body >  
    < /html > 
Output :

Hello TesDBAcademy

This is paragraph tag...

Basically CSS comments are ignored by the browsers and not displayed in output...





(CSS - Text Properties)