Day 16: CSS: Pseudo-classes

 1. Pseudo-classes :

  • A selector's keyword that specifies a specific state of the chosen element is called a CSS pseudo-class.     
  • :hover : When our mouse pointer is over a particular element, this pseudo-class can be used to give it a distinctive effect.    
  • Example :     
  • Code :

Output:
Before hovering : (The div background color is red)

     

      While hovering : (The div background color is changed from red to green)

      • :active : The active link is chosen and styled using the :active selector.     
      • Clicking on a link makes it active.         
      • All elements, not only links, can be utilized with the :active selector.     
      • Example: While you click on the link, the code in the example below will increase the font size of the link to 30px.

      Code :

       

      Comments

      Popular posts from this blog

      else-if condition in if-else statements: Concatenation in JavaScript :

      Day 9: CSS - Font Formate

      Day 28: CSS Animation, CSS Transition Animation Box size