css实现带左侧导航条pc端列表页悬浮放大效果代码

代码语言:html

所属分类:布局界面

代码描述:css实现带左侧导航条pc端列表页悬浮放大效果代码

代码标签: cs 左侧 导航条 pc端 列表 悬浮 放大

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

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

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

    <link href="https://fonts.googleapis.com/css?family=Roboto&display=swap" rel="stylesheet">
    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
 <style>
     body {
  font-family: 'Roboto';
  background-image: linear-gradient(-90deg , #3f5efb, #15175b);
  display: grid;
  place-items: center;
  margin: 0;
  min-height: 100vh;
}

.page {
  position: relative;
  display: grid;
  grid-template-columns: 200px auto;
  background-image: linear-gradient(-70deg , #f5f7ff, #c7c7c7);
  height: 600px;
  width: 80%;
  margin: 40px 0;
  border-radius: 80px;
}

.menu {
  margin: 20px;
  border-radius: 60px;
  box-sizing: border-box;
  list-style-type: none;
  height: calc(100% - 40px);
  width: 160px;
  background-image: linear-gradient(-40deg , #050b23, #26115f);
}

.menu a.menu-item {
  display: block;
  text-decoration: none;
}

.menu a.menu-item:hover .icon,
.menu a.menu-item.active .icon {
  background-image: linear-gradient(-70deg , #08bfb3, #44e4c4);
  color: #eee;
  border-radius: 10px 10px 0 10px;
  z-index: 2;
}

.menu a.menu-item:hover .text,
.menu a.menu-item.active .text {
  background-image: linear-gradient(-90deg , #2a71e5, #1a71a8);
  z-index: -1;
  border-radius: 10px 0 0 10px;
  width: 54%;
}

.menu .icon {
  position: relative;
  color: #0e8af6;
  margin: 5px;
  padding: 10px;
}

.menu .text {
  color: #eee;
  padding: 20px 20px 20px 25px;
  margin: 0 0 0 -30px;
}

.menu p {
  line-height: 24px;
  vertical-align: middle;
  display: inline-block;
}

.menu a.logo {
  display: block;
  width: 100%;
  height: 60px;
  text-align: center;
  visibility: hidden;
}

.main ul {
  list-style: none;
  margin-right: 20px;
  padding: 0;
}

.main ul li {
  width: 100%;
  display: grid;
  grid-template-columns: 30% 30% 30%;
  background: #fff;
  border: 1px solid #eee;
  padding: 10px;
  box-sizing: border-box;
  border-radius: 10px;
  border-right: 10px solid #44e4c4;
}

.main ul li:hover {
  transform: scale(1.1);
  box-shadow: 3px 5px 12px #555;
}

.main ul li div:not(:last-child) {
  border-right: 2px solid #eee;
}

.main ul li div {
  padding: 5px 10px;
}

h2 {
  max-width: 150px;
  margin: 10px 20px;
  padding: 10px 40px;
  border-bottom: 3px solid #44e4c4;
}
 </style>

</head>

<body>
    <!-- partial:index.partial.html -->
    <div class="page">
        <aside class="menu">
            <a href="" class="logo">Logo</a>
            <a href="" class="menu-item">
                <p class="material-icons icon">dashboard</p>
                <p class="text">Dashboard</p>
   .........完整代码请登录后点击上方下载按钮下载查看

网友评论0