css+js实现垂直滚动tab选项卡效果代码
代码语言:html
所属分类:选项卡
代码描述:css+js实现垂直滚动tab选项卡效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link
href="https://fonts.googleapis.com/css2?family=Poppins&display=swap"
rel="stylesheet"
type='text/css'
>
<style>
:root {
--white: #FFF;
--gray: #F3F3F3;
--gray-mid: #9D9D9D;
--gray-dark: #3e3e3e;
--gray-hover: #F7F7F7;
--body-background: #dfdfdf;
}
body {
font-family: 'Poppins', sans-serif;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
padding: 1rem;
background-color: var(--body-background);
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
.tabs-container {
padding: 1rem;
width: 100%;
max-width: 30rem;
min-width: 20rem;
display: flex;
margin: 0.75rem;
border-radius: 1rem;
background-color: var(--white);
box-shadow: rgba(100, 100, 111, 0.2) 0px 7px 29px 0px;
}
header {
position: relative;
}
.tab-content-wrapper {
overflow-y: hidden;
overflow-x: auto;
height: 18.75rem;
transition: all 0.45s ease-in-out;
padding: 0 1rem;
}
.tab-content h2 {
color: var(--gray-dark);
font-size: 1.2rem;
font-weight: 600;
margin-top: 0;
margin-bottom: 0.5rem;
}
.tab-content {
font-size: 0.8rem;
min-height: 18.75rem;
min-width: 15rem;
overflow-x: auto;
transition: all 0.45s ease-in-out;
}
.tabs {
position: relative;
display: flex;
flex-direction: column;
border-right: 1px solid #F0F0F0;
list-style-type: none;
padding-right: 1rem;
.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0