css实现下拉卡片伸缩个人菜单效果代码

代码语言:html

所属分类:菜单导航

代码描述:css实现下拉卡片伸缩个人菜单效果代码

代码标签: 卡片 伸缩 个人 菜单 效果

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


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

<head>

  <meta charset="UTF-8">

  
  <link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/font-awesome-4.7.0/css/font-awesome.min.css">
  
<style>
@import url('https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@300;400&display=swap');

*,
*::before,
*::after {
    padding: 0;
    margin: 0;
    box-sizing: inherit;
}

html{
    box-sizing: border-box;
    font-size: 62.5%; // 10px
}

ul{
    list-style-type: none;
}

a{
    text-decoration: none;
}

body{
    width: 100%;
    min-height: 100vh;
    font-family: 'Source Sans Pro', sans-serif;
    background-color: #f0fafb;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container{
    position: relative;
    width: 35rem;
    height: 11.5rem;
    background-color: #fff;
    padding: 2rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    overflow: hidden;
    transition: height .4s ease-in;
}
.container.active{
    height: 35rem;
    
}

.card{
    position: relative;
    display: flex;
    align-items: center;
}

.card-img img{
    width: 80px;

}

.card h2{
    font-size: 2.2rem;
    margin-left: 1.5rem;
    color: #222;
    letter-spacing: 2px;
}
.card h2 span{
    font-size: 1.6rem;
    font-weight: 400;
    color: #777;
    letter-spacing: 0px;
}

.container ul {
    position: relative;
    border-top: 1px solid rgba(0,0,0,0.1);
    margin-top: 1.5rem;
    padding: 2rem 0;

    display: flex;
    flex-direction: column;
    gap: 2rem;
}
.container ul a{
    font-size: 1.8rem;
    color: #444;
    transition: 0.2s;
}
.fa{
    font-size: 2rem;
    margin-right: 1rem;

}
.container ul a:hover{
    color: #3EDBF0;
}

.toggle{
    position: absolute;
    bottom: 0;
    right: 0;
    width: 4rem;
    height: 4rem;
    background-color: #3EDBF0;
    display: flex;
    justify-content: center;
  .........完整代码请登录后点击上方下载按钮下载查看

网友评论0