div+css实现列表网格布局切换效果代码
代码语言:html
所属分类:布局界面
代码描述:div+css实现列表网格布局切换效果代码,列表可切换成网格和横向列表两种布局模式。
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
* {
transform-style: preserve-3d;
box-sizing: border-box;
}
body {
margin: 0;
padding: 0;
width: 100vw;
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
perspective: 100vmin;
background: #303030;
overflow-x: hidden;
}
.button {
width: 20vmin;
height: 9vmin;
background: #303030;
display: flex;
align-items: center;
justify-content: center;
border-radius: 3px;
position: absolute;
top: 11vmin;
}
.base {
width: 17.5vmin;
background: #00000066;
height: 6.5vmin;
border-radius: 4px;
padding: 0.75vmin 0.5vmin 0.5vmin 0.125vmin;
display: flex;
align-items: center;
justify-content: center;
border: 1px solid #444;
border-color: #000 #444 #444 #000;
}
#list-grid:checked ~ .button .base {
padding: 0.75vmin 0.25vmin 0.5vmin 0.125vmin;
}
.selector {
width: 16vmin;
/* background: #33ff0066; */
height: 5vmin;
transition: 0.1s ease 0s;
}
.cuboid {
--height: 5;
--width: 8;
--depth: 3;
--hue: 200;
--sat: 10%;
height: calc(var(--height) * 1vmin);
width: calc(var(--width) * 1vmin);
position: absolute;
animation: cube1 0.6s linear 0s infinite;
transform: translate3d(0vmin, 0vmin, -1vmin);
}
.cuboid + .cuboid {
margin-left: 8vmin;
transform: rotateY(-15deg) translateZ(0.01vmin) translateX(0.25vmin);
}
.cuboid .side {
position: absolute;
top: 50%;
left: 50%;
height: 100%;
width: 100%;
bo.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0