Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Parallax Scrolling

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 400
    Comment on it

    Hello Readers! In today's blog we discuss about the technique which is in biggest trend on the web for some time now, that is , parallax scrolling! In web design use, parallax is referred as the scrolling technique which is used to create the illusion of depth on websites.

     

    Parallax websites are used to create remarkable and interesting effects in the browser. It is considered as one of the latest trends on the web which are used to implement immediate impact on the website. With parallax scrolling, while scrolling down the page, it creates a 3D effect as the background moves at a slower rate as compared to the foreground. In short we can say it creates "illusion of depth".

     

    So, are you ready to create your first parallax website using simple HTML5 and CSS3 languages.

     

    Create an HTML file and name it as say "index.html" and copy paste the below code to it.

     

    <body>
      <div class="wrapper">
       <div class="info-bar">
         <div class="container">
    	<p>Parallax scrolling is a technique in computer graphics and web design, where  background images move by the camera slower than foreground images, creating an illusion of depth in a 2D scene and adding to the immersion. The technique grew out of the multiplane camera technique used in traditional animation, since the 1930s. Parallax scrolling was popularized in 2D computer graphics and video games by the arcade games Moon Patrol, and Jungle Hunt,both released in 1982. Some parallax scrolling had earlier been used by the 1981 arcade game Jump Bug. - Source Google</p>
         </div>
        </div>
    
        <main>
    	<section class="module parallax parallax-1">
    	  <div class="container">
    	    <h1>Beautiful...!</h1>
    	  </div>
    	</section>
    
    	<section class="module content">
    	  <div class="container">
    	    <h2>Lorem Ipsum Dolor</h2>
    	    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nihil consequuntur, nesciunt dicta, esse rem ducimus itaque quis. Adipisci ullam nam qui illum debitis sit ad in delectus, repudiandae non dolorum! Lorem ipsum dolor sit amet, consectetur adipisicing elit. Suscipit veritatis, facere aliquid itaque tempore consequatur nihil sint enim aliquam id saepe magnam totam repellat placeat a fugit nulla molestias voluptas.</p>
    	    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nihil consequuntur, nesciunt dicta, esse rem ducimus itaque quis. Adipisci ullam nam qui illum debitis sit ad in delectus, repudiandae non dolorum! Lorem ipsum dolor sit amet, consectetur adipisicing elit. Suscipit veritatis, facere aliquid itaque tempore consequatur nihil sint enim aliquam id saepe magnam totam repellat placeat a fugit nulla molestias voluptas.</p>
    	    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nihil consequuntur, nesciunt dicta, esse rem ducimus itaque quis. Adipisci ullam nam qui illum debitis sit ad in delectus, repudiandae non dolorum! Lorem ipsum dolor sit amet, consectetur adipisicing elit. Suscipit veritatis, facere aliquid itaque tempore consequatur nihil sint enim aliquam id saepe magnam totam repellat placeat a fugit nulla molestias voluptas.</p>
    	    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nihil consequuntur, nesciunt dicta, esse rem ducimus itaque quis. Adipisci ullam nam qui illum debitis sit ad in delectus, repudiandae non dolorum! Lorem ipsum dolor sit amet, consectetur adipisicing elit. Suscipit veritatis, facere aliquid itaque tempore consequatur nihil sint enim aliquam id saepe magnam totam repellat placeat a fugit nulla molestias voluptas.</p>
    	  </div>
    	</section>
    
    	<section class="module parallax parallax-2">
    	  <div class="container">
    	    <h1>Wow..!</h1>
    	  </div>
            </section>
    			
            <section class="module content">
    	  <div class="container">
    	    <h2>Lorem Ipsum Dolor</h2>
    	    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nihil consequuntur, nesciunt dicta, esse rem ducimus itaque quis. Adipisci ullam nam qui illum debitis sit ad in delectus, repudiandae non dolorum! Lorem ipsum dolor sit amet, consectetur adipisicing elit. Suscipit veritatis, facere aliquid itaque tempore consequatur nihil sint enim aliquam id saepe magnam totam repellat placeat a fugit nulla molestias voluptas.</p>
    	     <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nihil consequuntur, nesciunt dicta, esse rem ducimus itaque quis. Adipisci ullam nam qui illum debitis sit ad in delectus, repudiandae non dolorum! Lorem ipsum dolor sit amet, consectetur adipisicing elit. Suscipit veritatis, facere aliquid itaque tempore consequatur nihil sint enim aliquam id saepe magnam totam repellat placeat a fugit nulla molestias voluptas.</p>
    	     <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nihil consequuntur, nesciunt dicta, esse rem ducimus itaque quis. Adipisci ullam nam qui illum debitis sit ad in delectus, repudiandae non dolorum! Lorem ipsum dolor sit amet, consectetur adipisicing elit. Suscipit veritatis, facere aliquid itaque tempore consequatur nihil sint enim aliquam id saepe magnam totam repellat placeat a fugit nulla molestias voluptas.</p>
    	     <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nihil consequuntur, nesciunt dicta, esse rem ducimus itaque quis. Adipisci ullam nam qui illum debitis sit ad in delectus, repudiandae non dolorum! Lorem ipsum dolor sit amet, consectetur adipisicing elit. Suscipit veritatis, facere aliquid itaque tempore consequatur nihil sint enim aliquam id saepe magnam totam repellat placeat a fugit nulla molestias voluptas.</p>
    	   </div>
    	 </section>
    			
             <section class="module parallax parallax-3">
    	   <div class="container">
    	     <h1>Classy..!</h1>
    	   </div>
    	 </section>
    			
             <section class="module content">
    	   <div class="container">
    	     <h2>Lorem Ipsum Dolor</h2>
    	     <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nihil consequuntur, nesciunt dicta, esse rem ducimus itaque quis. Adipisci ullam nam qui illum debitis sit ad in delectus, repudiandae non dolorum! Lorem ipsum dolor sit amet, consectetur adipisicing elit. Suscipit veritatis, facere aliquid itaque tempore consequatur nihil sint enim aliquam id saepe magnam totam repellat placeat a fugit nulla molestias voluptas.</p>
    	     <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nihil consequuntur, nesciunt dicta, esse rem ducimus itaque quis. Adipisci ullam nam qui illum debitis sit ad in delectus, repudiandae non dolorum! Lorem ipsum dolor sit amet, consectetur adipisicing elit. Suscipit veritatis, facere aliquid itaque tempore consequatur nihil sint enim aliquam id saepe magnam totam repellat placeat a fugit nulla molestias voluptas.</p>
    	     <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nihil consequuntur, nesciunt dicta, esse rem ducimus itaque quis. Adipisci ullam nam qui illum debitis sit ad in delectus, repudiandae non dolorum! Lorem ipsum dolor sit amet, consectetur adipisicing elit. Suscipit veritatis, facere aliquid itaque tempore consequatur nihil sint enim aliquam id saepe magnam totam repellat placeat a fugit nulla molestias voluptas.</p>
    	     <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nihil consequuntur, nesciunt dicta, esse rem ducimus itaque quis. Adipisci ullam nam qui illum debitis sit ad in delectus, repudiandae non dolorum! Lorem ipsum dolor sit amet, consectetur adipisicing elit. Suscipit veritatis, facere aliquid itaque tempore consequatur nihil sint enim aliquam id saepe magnam totam repellat placeat a fugit nulla molestias voluptas.</p>
    	   </div>
    	 </section>
         </main>
      </div>
    </body>

     

    Next step, create a stylesheet “style.css” and copy paste the below code to it.

     

    *{text-decoration: none;list-style: none;}
    body{color: #787878}
    
    
    .wrapper{margin:0 auto;width: 100%;}
    .info-bar{background-color: #fff;padding: 5px 0;text-align: center;}
    .container{margin: 0 auto;max-width: 960px;padding: 0 20px;width: 100%}
    .container > p{color:  #b4b4b4}
    
    
    section.module.parallax{background-attachment: fixed;background-position: top center;background-repeat: no-repeat;background-size: cover;height: 600px;}
    section.module.parallax.parallax-1{background-image: url("../images/2.jpg");}
    section.module.parallax h1{color: #FFE1DF;text-align: center;padding-top: 200px;letter-spacing: 1px;text-transform: uppercase;font-size: 60px}
    
    
    section.module.content{padding: 40px 0;}
    section.module.parallax.parallax-2{background-image: url("../images/3.jpg");}
    section.module.parallax.parallax-3{background-image: url("../images/4.jpg");}
    

     

    And that's all!! Your parallax website is ready. Hope you find this blog interesting. For any query please write your comments below.

     

    For demo file click on the below link.

     

    Happy Coding!

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: