How to style buttons?
- CSS pseudo selectors are used for styling buttons and links.
- For styling buttons and links, we use: visited, hover, and active pseudo selectors.
This will be our basic boilerplate code for Link Styling in CSS
index.html
<!DOCTYPE html>
<html>
<head>
<title> Styling Links in CSS </title>
<style>
</style>
</head>
<body>
<a href="https://www.geekshelp.org" target="_blank"> Geeks Help </a>
</body>
</html>
Uses of some pseudo Selectors
i) hover - This selector is used when we want to apply any changes on hover.
a:hover {
color: white;
background: red;
}
ii) active - This selector is used when we want to show the active state of the button or link.
a:active {
color: white;
background: darkblue;
}
iii) visited - It is used when we want to apply changes to the link after visiting the link.
a:visited {
color: purple;
}