效果查看:https://codepen.io/Chokcoco/pen/KbBXQM?editors=1100
CSS:
body {
position: relative;
padding: 50px;
font-size: 24px;
line-height: 30px;
background-image: linear-gradient(to right top, #ffcc00 50%, #eee 50%);
background-size: 100% calc(100% - 100vh + 5px);
background-repeat: no-repeat;
z-index: 1;
}
body::after {
content: "";
position: fixed;
top: 5px;
left: 0;
bottom: 0;
right: 0;
background: #fff;
z-index: -1;
}
/**
* Unrelated css
*/
h1 {
font-size: 32px;
line-height: 60px;
}
ul {
margin-top: 30px;
}
p {
font-size: 24px;
line-height: 30px;
margin-top: 30px;
}
HTML:
<h1>不可思议的纯 CSS 进度条效果</h1>
<p>在继续阅读下文之前,你可以先缓一缓。尝试思考一下上面的效果或者动手尝试一下,不借助 JS ,能否巧妙的