div+css实现鼠标悬停按钮多层阴影动画效果代码

代码语言:html

所属分类:悬停

代码描述:div+css实现鼠标悬停按钮多层阴影动画效果代码

代码标签: div css 鼠标 悬停 按钮 多层 阴影 动画

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  


  <link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300..700&display=swap" rel="stylesheet">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css">

  
  
<style>
:root {
  --primary-color: #c8dc71;
  --gradient-color: linear-gradient(270deg, #ce6cec 0%, #dc717f 100%);
  --gradient-color-2: linear-gradient(270deg, #c8dc71 0%, #6cece1 100%);
  --radius: 4px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
}

body {
  font-family: "Space Grotesk", sans-serif;
  background-color: #16181b;
}

.container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

.button {
  font-size: 18px;
  font-weight: 500;
  text-decoration: none;
  padding: 13px 30px;
  border-radius: var(--radius);
  cursor: pointer;
  position: relative;
  background: #000000;
  transition: all 0.4s ease-in-out;
}

.button span {
  color: #ffffff;
  transition: color 0.4s ease-in-out;
}

.button:hover span {
  color: var(--primary-color);
}

.button::after,
.button::before {
  content: "";
  pointer-events: none;
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: -1;
  transition: all 0.4s ease-in-out;
  border-radius: var(--radius);
  transform: translate(0px, 0px);
}

.button:hover::after {
  transform: transla.........完整代码请登录后点击上方下载按钮下载查看

网友评论0