Home  >  Article  >  Web Front-end  >  CSS implementation of reading progress bar

CSS implementation of reading progress bar

高洛峰
高洛峰Original
2017-02-27 15:10:351428browse

Reading progress bar can be realized without JavaScript

Look at the picture and talk

CSS实现阅读进度条

Go directly to the code

    <style>
        html,body{margin:0;}
        header{
            position: fixed;
            top:0;
            height: 125px;
            width: 100%;
            background: white;
        }

        main{
            margin-top: 128px;
        }

        @supports (height: 100vh) { 
            body{   
                background: linear-gradient(to right top, #0089f2 50%, #DDD 50%);
                background-size: 100% calc(100% - 100vh + 129px);
                background-repeat: no-repeat;
            }
            body:before{
                content:&#39;&#39;;
                position: fixed;
                top: 128px;
                bottom: 0;
                width: 100%;
                z-index: -1;
                background: white;
            }
        }
     </style>
rrree


For more CSS implementation of reading progress bar related articles, please pay attention to the PHP Chinese website!


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:CSS property borderNext article:CSS property border