Button Effect
HTML CODE:-
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" integrity="sha512-DTOQO9RWCH3ppGqcWaEA1BIZOC6xxalwEsw9c2QQeAIftl+Vegovlnee1c9QX4TctnWMn13TZye+giMm8e2LwA==" crossorigin="anonymous" referrerpolicy="no-referrer" /> <title></title> </head> <body> <a href="#" class="btn"><i class="fa-brands fa-facebook"></i></a> <a href="#" class="btn"><i class="fa-brands fa-twitter"></i></a> <a href="#" class="btn"><i class="fa-brands fa-github"></i></a> <a href="#" class="btn"><i class="fa-brands fa-youtube"></i></a> </body> </html> |
CSS CODE:-
body{ padding: 0px; margin: 0px; display: flex; align-items: center; justify-content: center; min-height: 100vh; background:#ededed; } .btn{ position: relative; height: 60px; width: 60px; margin: 20px; background: #ededed; border-radius: 50%; box-shadow: -7px -7px 20px 0 rgba(255, 255, 255, 0.9),7px 7px 20px 0 rgba(0, 0, 0, 0.3); transition: 0.2s; } .btn:hover{ transform: scale(1.1); } .btn::before{ content: ""; position: absolute; height: 70%; width: 70%; background: #ededed; border-radius: 50%; top: 50%; left: 50%; transform: translate(-50%,-50%); } .btn:hover::before{ box-shadow: inset -7px -7px 20px 0 rgba(255, 255, 255, 0.9),inset 7px 7px 20px 0 rgba(0, 0, 0, 0.3); } .btn i{ font-size: 30px; top: 50%; left: 50%; transform: translate(-50%,-50%); position: absolute; transition: 0.2s; } .btn:hover i{ font-size: 25px; } .btn:nth-child(1){ color: blue; } .btn:nth-child(2){ color: skyblue; } .btn:nth-child(3){ color: black; } .btn:nth-child(4){ color: red; } |