CSS pseudo-classes are used to add special effects to HTML elements.
You can set effects to the following HTML elements:
when a user mouses over it.
when a user mouses gets focus.
when a user visit and unvisited links .
Syntax : Pseudo Classes (Events)
You can set following properties to pseudo-classes −
:link - a normal, unvisited link.
:visited - a link the user has visited link.
:hover - a link when the user mouses a:hover - a link when the user mouses over it.
:active - a link on which the user is currently clicking.
:focus - used to add special style to an element while the element has focus.
:first-child - used to add special style to an element that is the first child of some other element.
:lang - Used to specify a language to use in a specified element.
Links can be displayed in different ways.Check how links are displayed to different events. CSS - Links Tutorial
Buttons can be displayed in different ways.Check how buttons are displayed to different events. CSS - Links Tutorial
<p>Code Always To Become Best Programmer.</p>
<form action="/action_page.php" method="get">
First Name: <input type="text" name="fname"><br>
Password: <input type="password" name="pass"><br>
<input type="submit" value="Submit">
When the above code is compiled , it produces the following result.