css+div实现下拉菜单动画效果代码

代码语言:html

所属分类:菜单导航

代码描述:css+div实现下拉菜单动画效果代码

代码标签: css div 下拉 菜单 动画

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


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

<head>

  <meta charset="UTF-8">
  

  <style>
.area::after {
  content: "";
  display: block;
  width: 101%;
}
</style>
  
  
  
<style>
:root {
  --clr: #2196f3;
  --bgc: #ffffff;
  --icon: #ffffff;
  --tra: all 0.5s ease 0s;
}

body {
  height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(to bottom, #4e4376, #2b5876);
  font: 1em system-ui, sans-serif;
  line-height: 1.4;
}

body:before, body:after {
    content: "";
    position: absolute;
    width: 1em;
    height: 1em;
    border: 0em solid #fff;
    border-width:0 0 0.2em 0.2em;
    transform: rotate(45deg);
    left: 1.25em;
    bottom: 1.35em;
    border-radius: 0.1em;
}

body:after {
    left: inherit;
    right: 1.25em;
    transform: rotate(-135deg);
}

h2 {
  line-height: 1.25;
  margin: 1em 0 1em 0;
  color: #4d4476;
  font-weight: 500;
}


.area {
  background: 
    linear-gradient(-88.75deg, #fff0 1.5em, var(--bgc) calc(1.5em + 1px) 55%, #fff0 calc(55% + 1px)), 
    linear-gradient(88.75deg, #fff0 1.5em, var(--bgc) calc(1.5em + 1px) 55%, #fff0 calc(55% + 1px));
  padding: 3em 4em;
  width: 20em;
  transition: var(--tra);
  position: relative;
  /*overflow: auto;*/
  word-wrap: break-word;
  filter: drop-shadow(0px 10px 10px #0008);
}

.area:before {
  content: "";
  background: var(--clr);
  width: 100%;
  height: 3.5em;
  position: absolute;
  top: 0;
  left: 0;
  clip-path: polygon(0 0, 100% 0, 99% 100%, 1% 85%);
}

.area:after {
    content: "";
    background: linear-gradient(178.5deg, #fff0 1.15em, #fff calc(1.15em + 1px));
    width: calc(100% - 1em) !important;
    height: 1.75em;
    position: absolute;
    top: -1.........完整代码请登录后点击上方下载按钮下载查看

网友评论0