css基本3d操作布局示例代码
代码语言:html
所属分类:布局界面
代码描述:css基本3d操作布局示例代码,通过transform、preserve-3d等css三维属性实现三维操作dom元素示例代码。
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
html {
height:100dvh;
}
body {
min-height:100%;
margin:0;
}
body {
padding:2em;
font-family:saira, sans-serif;
background-color: #ccc;
display:grid;
grid-template-columns:repeat(auto-fit, min(100%, 25em));
/* place-items:start center; */
place-content:start center;
grid-gap:2em;
}
ul {
margin:0;
padding:0;
list-style:none;
position:relative;
width:100%;
aspect-ratio:2;
display:grid;
place-items:center;
background:#fff9;
}
ul::before {
content: attr(data-title);
position:absolute;
right:.5em;
bottom:0;
font-size:.75em;
}
li {
height:40%;
aspect-ratio:1;
display:flex;
justify-content:center;
align-items:center;
background-image:linear-gradient(in oklch, deeppink, dodgerblue);
border-radius:5%;
}
li:nth-of-type(even) {
background-image:linear-gradient(in oklch, dodgerblue, lime);
}
li:nth-of-type(1) { --i:1; }
li:nth-of-type(2) { --i:2; }
li:nth-of-type(3) { --i:3; }
li:nth-of-type(4) { --i:4; }
li:nth-of-type(5) { --i:5; }
li:nth-of-type(6) { --i:6; }
li:nth-of-type(7) { --i:7; }
li:nth-of-type(8) { --i:8; }
li:nth-of-type(9) { --i.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0