纯css+div实现年份是否闰年计算代码
代码语言:html
所属分类:其他
代码描述:纯css+div实现年份是否闰年计算代码,无js代码,纯粹css和div实现。
代码标签: 纯 css div 年份 是否 闰年 计算 代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<link rel='stylesheet' href='https://fonts.googleapis.com/css2?family=Nabla&display=swap'>
<style>
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
--display-height: 160px;
--arrow-height: 30px;
height: 100vh;
background: linear-gradient(160deg, #555 0%, #222 100%);
}
.leap-year {
position: relative;
user-select: none;
-webkit-user-select: none;
}
.cb {
position: absolute;
top: calc(50vh - 50px - var(--display-height) / 2 - var(--arrow-height));
z-index: 100;
display: none;
width: 100px;
height: var(--arrow-height);
appearance: none;
-moz-appearance: none;
-webkit-appearance: none;
cursor: pointer;
}
.cb:checked {
top: calc(50vh - 50px + var(--display-height) / 2);
}
.cb.n-0, .cb:checked + .cb {
display: block;
}
.cb.closer {
display: none !important;
}
.up,
.down {
position: absolute;
z-index: 100;
width: 100px;
height: var(--arrow-height);
opacity: 1;
background: gold;
transition: opacity 100ms linear;
pointer-events: none;
}
.up {
top: calc(50vh - 50px - var(--display-height) / 2 - var(--arrow-height));
clip-path: polygon(40% 70%, 60% 70%, 50% 30%);
}
.down {
top: calc(50vh - 50px + var(--display-height) / 2);
clip-path: polygon(40% 30%, 60% 30%, 50% 70%);
}
.th-0:not(:checked) ~ .arrows .down.th,
.th-8:checked ~ .arrows .up.th,
.h-0:not(:checked) ~ .arrows .down.h,
.h-8:checked ~ .arrows .up.h,
.t-0:not(:checked) ~ .arrows .down.t,
.t-8:checked ~ .arrows .up.t,
.o-0:not(:checked) ~ .arrows .down.o,
.o-8:checked ~ .arrows .up.o {
opacity: 0.3;
}
.display {
--numbers: "0 \a 1 \a 2 \a 3 \a 4 \a 5 \a 6 \a 7 \a 8 \a 9";
--number: 0;
position: absolute;
top: calc(50vh - 50px - var(--display-height) / 2);
z-index: 200;
display: flex;
overflow: hidden;
width: 100px;
height: var(--display-height);
border-right: 4px solid #9.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0