HTML+CSS background Scrolling Effect

 Scrolling Effect:-

CODE:-
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body{
            margin0%;
            padding0%;
            font-familysans-serif;
        }
        
        .container{
            positionrelative;
            width100%;
            height100vh;
            overflowauto;
            scroll-snap-type: y mandatory;
        }
        .container .section {
            positionrelative;
            width100%;
            height100%;
            scroll-snap-alignstart;
            background-blend-modemultiply;
        }
        .container .section:nth-child(1){
            backgroundurl(resources/n1.jpg);
            background-sizecover;
            background-attachmentfixed
        }
        .container .section:nth-child(2){
            background#ff0 url(resources/n2.jpg);
            background-sizecover;
            background-attachmentfixed;
        }
        .container .section:nth-child(3){
            background:url(resources/n3.jpg);
            background-sizecover;
            background-attachmentfixed;
        }
        .container .section:nth-child(4){
            backgroundurl(resources/n4.jpg);
            background-sizecover;
            background-attachmentfixed;
        }
        .container .section:nth-child(5){
            backgroundurl(resources/n5.jpg);
            background-sizecover;
            background-attachmentfixed;
        }
         .container .section .container {
             positionabsolute;
             bottom50px;
             left50px;
             max-width700px;
         }
         .container .section .container h2 {
             background#fff;
             color#111;
             font-weight600;
             displayinline-block;
             padding10px 20px;
             font-size2em;
         }
         .container .section .container h2 {
             background#fff;
             color#111;
             font-weight600;
             displayinline-block;
             padding10px 20px;
             font-size2em;
         }.container .section .container p {
             background#fff;
             color#111;
             font-weight300;
             padding10px 20px;
             margin-top10px;
         }
    </style>
</head>
<body>
    <div class="container">
        <div class="section">
            <div class="content">
                <h2>Section One Title</h2>
                <p>If you are using the Postman web client, <br> you will need to also download the Postman desktop agent.
                     The Postman agent overcomes the Cross Object Resource Sharing <br> (CORS) limitations of browsers,
                     and facilitates API request sending from your browser version of <br> Postman.</p>
            </div>
        </div>
        <div class="section">
            <div class="content">
                <h2>Section Two Title</h2>
                <p>If you are using the Postman web client, <br> you will need to also download the Postman desktop agent.
                     The Postman agent overcomes the Cross Object Resource Sharing <br> (CORS) limitations of browsers,
                     and facilitates API request sending from your browser version of <br> Postman.</p>
            </div>
        </div>
        <div class="section">
            <div class="content">
                <h2>Section Three Title</h2>
                <p>If you are using the Postman web client, <br> you will need to also download the Postman desktop agent.
                     The Postman agent overcomes the Cross Object Resource Sharing <br> (CORS) limitations of browsers,
                     and facilitates API request sending from your browser version of <br> Postman.</p>
            </div>
        </div>
        <div class="section">
            <div class="content">
                <h2>Section Four Title</h2>
                <p>If you are using the Postman web client, <br> you will need to also download the Postman desktop agent.
                     The Postman agent overcomes the Cross Object Resource Sharing <br> (CORS) limitations of browsers,
                     and facilitates API request sending from your browser version of <br> Postman.</p>
            </div>
        </div>
        <div class="section">
            <div class="content">
                <h2>Section five Title</h2>
                <p>If you are using the Postman web client, <br> you will need to also download the Postman desktop agent.
                     The Postman agent overcomes the Cross Object Resource Sharing <br> (CORS) limitations of browsers,
                     and facilitates API request sending from your browser version of <br> Postman.</p>
            </div>
        </div>
    </div>
</body>
</html>


OUTPUT:-


~


Comments

Popular Posts