带背景色切换的tab多标签选项卡切换效果代码
代码语言:html
所属分类:选项卡
代码描述:带背景色切换的tab多标签选项卡切换效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" class="bg--big">
<head>
<meta charset="UTF-8">
<style>
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 300;
src: url(https://fonts.gstatic.com/s/roboto/v20/KFOlCnqEu92Fr1MmSU5fBBc9.ttf) format('truetype');
}
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
src: url(https://fonts.gstatic.com/s/roboto/v20/KFOmCnqEu92Fr1Mu4mxP.ttf) format('truetype');
}
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 700;
src: url(https://fonts.gstatic.com/s/roboto/v20/KFOlCnqEu92Fr1MmWUlfBBc9.ttf) format('truetype');
}
:root {
transition: all 300ms;
}
:root.bg--big {
background-color: #00BCD4;
}
:root.bg--medium {
background-color: #E53935;
}
:root.bg--small {
background-color: #4527A0;
}
body {
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
font-family: 'Roboto', sans-serif;
transform: translateZ(0);
font-weight: 400;
}
button {
border: none;
background: transparent;
}
.controller-container {
margin-bottom: 5%;
text-align: center;
}
.controller {
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
display: inline-block;
margin: 0 20px;
font-size: 22px;
padding: 10px 0;
color: #FFF;
position: relative;
transition: all 100ms cubic-bezier(0.165, 0.84, 0.44, 1);
}
.controller:after {
content: "";
height: 3px;
display: block;
position: absolute;
bottom: 0;
width: 0;
transition: all 300ms cubic-bezier(0.165, 0.84, 0.44, 1);
background-color: #FFF;
}
.controller.is_current:after {
width: 100%;
}
.controller:hover,
.controller.is_current {
transform: translate3d(0, -5px, 0);
cursor: pointer;
}
.card {
will-change: transform;
margin: 8px;
position: relative;
border-radius: 2px;
overflow: hidden;
background-color: #fafafa;
height: 35%;
width: 344px;
transition: all 400ms cubic-bezier(0.165, 0.84, 0.44, 1);
box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.37);
}
.card:hover {
c.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0