div+css实现炫酷立体按钮代码

代码语言:html

所属分类:布局界面

代码描述:div+css实现炫酷立体按钮代码

代码标签: div css 立体 按钮 代码

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


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

<head>

  <meta charset="UTF-8">
  


  <link rel='stylesheet' href='https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;700&amp;display=swap'>
  
<style>
.fancy-button {
  --fancy-button-gradient-0: #8D49FD;
  --fancy-button-gradient-50: #7F56F3;
  --fancy-button-gradient-100: #5691F3;
  --fancy-button-inner-shadow-top: rgba(233, 209, 255, 0.2);
  --fancy-button-inner-shadow-top-lg: rgba(9, 12, 60, 0.1);
  --fancy-button-inner-shadow-bottom: rgba(137, 222, 246, 0.3);
  --fancy-button-shine-top: #E9D1FF;
  --fancy-button-shine-bottom: #ADFFF9;
  font-family: "Poppins";
  font-weight: 500;
  font-size: 15px;
  line-height: 21px;
  text-shadow: 0px 0.5px 0.5px rgba(0, 0, 0, 0.2);
  padding: 0;
  margin: 0;
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  border: none;
  outline: none;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  z-index: 1;
  border-radius: 25px;
  color: #fff;
  background-image: linear-gradient(to bottom, var(--fancy-button-gradient-0) 0%, var(--fancy-button-gradient-50) 50%, var(--fancy-button-gradient-100) 100%);
  box-shadow: 0px 4px 12px rgba(9, 12, 60, 0.15), 0px 2px 8px rgba(9, 12, 60, 0.15), 0px 1px 3px var(--fancy-button-inner-shadow-top-lg), inset 0px 1px 1px var(--fancy-button-inner-shadow-top), inset 0px -1px 3px var(--fancy-button-inner-shadow-bottom);
}
.fancy-button:before, .fancy-button:after {
  content: "";
  position: absolute;
  border-radius: inherit;
  will-change: transform;
}
.fancy-button:before {
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--fancy-button-shine-top);
  width: 96px;
  height: 6px;
  top: -3px;
  opacity: 0.6;
  filter: blur(6px);
  transition: opacity 0.25s;
}
.fancy-button:after {
  inset: 0;
  background-image: url("https://assets.codepen.io/165585/noise_1.png");
  background-size: cover;
  z-index: 2;
  opacity: 0.2;
  mix-blend-mode: overlay;
  pointer-events: none;
}
.fancy-button span {
  display: block;
  padding: 12px 24px;
  border-radius: inherit;
  overflow: hidden;
  position: relative;
  background-image: linear-gradient(to bottom, var(--fancy-button-shine-top), transparent 8px);
  background-position: 0 -6px;
  background-repeat: no-repeat;
  z-index: 1;
}
.fancy-button span:before, .fancy-button span:after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 50%;
  background-color: var(--fancy-button-shine-bottom);
  transition: opacity 0.25s, transform 0.25s;
  will.........完整代码请登录后点击上方下载按钮下载查看

网友评论0