Hi dear welcome to "CodePrime" Blog . In this post we are going to learn How To use CSS Link Property In Your Website. First Creat A index.html file Copy This HTML CODE and pest it one your code editor. 2ndly creat style.css file Then Copy The CSS CODE and pest it then open the index.html file with your browser.
HTML CODE
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<a class="btn-1" href="#">CodePrime-1</a>
<a class="btn-2" href="#">CodePrime-1</a>
<a class="btn-3" href="#">CodePrime-1</a>
</body>
</html>
CSS CODE
a:hover{
background: red !important;
color: #fff;
}
a.btn-1{
background: blue !important;
color: #fff;
}
.btn-2:visited{
background: red !important;
color: #fff;
}
.btn-3:active{
background: yellow !important;
color: #000;
}
a{
padding: 10px 20px;
background: #fff;
margin: 10px 0;
text-decoration: none;
font-size: 2rem;
}
body{
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
min-height: 100vh;
background: linear-gradient(45deg,blue,white);
}
0 Comments