纯div+css实现一个秒表计时效果代码
代码语言:html
所属分类:布局界面
代码描述:纯div+css实现一个秒表计时效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link href="https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@300&display=swap" rel="stylesheet">
<style>
*,
*:before,
*:after {
box-sizing: border-box;
line-height: 1rem;
font-family: inherit;
}
html {
--paper: #f2f2f2;
--ink: #333;
font-family: "Roboto Mono", monospace;
font-size: 1.5rem;
}
body {
margin: 0;
min-height: 100vh;
color: var(--ink);
background-color: var(--paper);
display: flex;
justify-content: center;
align-items: center;
}
#ui {
width: 100%;
max-width: 18rem;
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
gap: 1rem;
padding: 0.5rem;
}
.outline, input[name=state]#reset:focus ~ .reset-btn, input[name=state]#pause:focus ~ .pause-btn, input[name=state]#start:focus ~ .start-btn {
outline: 1px solid var(--paper);
outline-offset: 1px;
}
.disabled, input[name=state]#reset:checked ~ .pause-btn, input[name=state]#pause:checked ~ .pause-btn, input[name=state]#start:checked ~ .reset-btn,
input[name=state]#start:checked ~ .start-btn {
pointer-events: none;
color: #aaa;
opacity: 0.4;
}
input[name=state] {
position: absolute;
opacity: 0;
left: -100vw;
}
input[name=.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0