CSS Selectors

Home / CSS / CSS Selectors

CSS Selectors


Basic  Type of Selectors: 
  1.  By Tag Name Selector
  2. Class Selector
  3. Id Selector
  4. Descendant Selector

1.By  Tag Name Selector:

<style>
        h1{
   
        }
        p{
   
        }
        div{
   
        }
       </style>



2.Class Selector:

<style>
        .heading{
   
        }
        .para{
   
        }
        .Box{
   
        }
       </style>



3. Id Selector:

<style>
        #heading{
   
        }
        #para{
   
        }
        #box{
   
        }
       </style>




4.  Descendant Selector:


<style>       
       #heading a{
   
        }
      .list p{
   
        }
        #box a{

}
</style>