css+div实现按钮悬浮动画效果代码

代码语言:html

所属分类:悬停

代码描述:css+div实现按钮悬浮动画效果代码

代码标签: css div 按钮 悬浮 动画

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

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

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

  
<style>
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  width: 100dvw;
  height: 100dvh;
  background: #121212;
  display: flex;
  justify-content: center;
  align-items: center;
}

button {
  appearance: none;
  background: transparent;
  border: none;
  cursor: pointer;
  isolation: isolate;
}

.button {
  font-size: 16px;
  line-height: 1.5;
  font-weight: 500;
  width: 240px;
  border-radius: 9999rem;
  background: #efefef;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  isolation: isolate;
  overflow: hidden;

  & > span.text {
    color: #121212;
    width: 100%;
    text-align: left;
    padding-block: 12px;
    padding-left: 24px;
    z-index: 2;
    transition: all 200ms ease;
  }

  & > div.overlay {
    color: #ededed;
    width: 48px;
    height: calc(100% - 2px);
    display: flex;
    justify-content: flex-en.........完整代码请登录后点击上方下载按钮下载查看

网友评论0