Skip to main content

Make a Simple Parallax Scrolling Effect for beginners

    In this Tutorial, we will show you how to create a simple parallax scrolling effect using only CSS. Parallax scrolling is a popular web design technique where background images move slower than foreground images, creating a 3D illusion as you scroll down the page. We'll be using CSS transforms and transitions to achieve this effect, so no JavaScript is required. Whether you're a beginner or an experienced web developer, this tutorial will provide you with the knowledge you need to add a touch of depth and movement to your website. So sit back, relax, and enjoy the tutorial. 
 
index.html
<!DOCTYPE html>

  <html>
      <head>
          <title>Parallax Scrolling</title>
          <meta name="viewport" content="width=device-width, initial-scale=1">
          <link rel="stylesheet" type="text/css" href="style.css">
          <link href="https://fonts.googleapis.com/css?family=Montserrat|Mr+Dafoe" rel="stylesheet">
      </head>
      <body>
          <div class="plx-image1">
              <div class="text1">Parallax</div>
              <div class="text2">Scroll down to see the effect</div>
          </div>
          <div class="content-1">
              <div class="text3">KEEP ON SCROLLING</div>
              <div class="text4">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna
              aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
              Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</div>
          </div>
          <div class="plx-image2"></div>
          <div class="content-2">
              <div class="text5">THANKS FOR WATCHING</div>
          </div>
      </body>
  </html>


style.css

html, body{
    margin: 0px;
    height: 100%;
    overflow-x: hidden;
}

.plx-image1{
    background-image: url(images/image\ 1.jpg);
    text-align: center;
    width: 100%;
    height: 900px;
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.text1{
    font-size: 280px;
    padding-top: 200px;
    font-family: 'Mr Dafoe', cursive;
    color: #FFFFFF;
    -webkit-text-fill-color: rgba (255, 255, 255, 1);
    text-shadow: -3px -3px 12px #313a49;
    -webkit-transform: skew(-5deg,-5deg);
    transform: skew(-5deg,-5deg);
    font-weight: normal;
}

.text2{
    font-size: 40px;
    color: white;
    margin: 0 0 20px 0;
    font-family: 'Montserrat', sans-serif;
}

.content-1{
    height: auto;
    width: 100%;
    background-color: #f2f2f2;
    text-align: center;
}

.text3{
    font-family: 'Montserrat', sans-serif;
    font-size: 80px;
    background-color: #f2f2f2;
    padding-top: 50px;
}

.text4{
    width: 70%;
    margin-left: 15%;
    padding: 30px 0 80px 0;
    font-family: 'Montserrat', sans-serif;
    font-size: 20px;
    background-color: #f2f2f2;
    letter-spacing: 0.1em;
    line-height: 1.8;
}

.plx-image2{
    background-image: url(images/image\ 2.jpg);
    text-align: center;
    width: 100%;
    height: 800px;
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.content-2{
    height: auto;
    width: 100%;
    text-align: center;
    background-color: #f2f2f2;
}

.text5{
    font-family: 'Montserrat', sans-serif;
    font-size: 100px;
    padding: 80px 0 80px 0;
    letter-spacing: 0.2em;
}
Watch Full Video Here:

Comments

Popular posts from this blog

Auto Image Slider using CSS Only

     Are you ready to learn how to create an image slider using only CSS? Look no further! In this tutorial, we'll walk you through the step-by-step process of building a sleek and modern image slider using HTML and CSS. No JavaScript required! In this tutorial We'll cover setting up the HTML structure for the slider.       This will include creating the container element and styling the slider with CSS. You'll also learn how to add transitions and animations to create a smooth sliding effect. By the end of this tutorial, you'll have a fully functional image slider that you can use on your own website. Whether you're a beginner or an experienced developer, this tutorial has something for you. So let's get started creating your own image slider using CSS today! index.html <html> <head> <meta charset="utf-8"> <link rel="stylesheet" href="css/style.css"...

Control Your Weights using this Javascript App - Simple BMI Calculator

       Embark on a coding journey that will demystify the intricacies of web development with our comprehensive tutorial, "Creating a BMI Calculator Using JavaScript." Whether you're a novice in the realm of programming or an enthusiast seeking to augment your JavaScript skills, this step-by-step guide promises to be an illuminating experience. To kick off our journey, we'll delve into the fundamental building blocks of web development—HTML, CSS, and JavaScript. This tutorial caters to individuals ranging from absolute beginners to those looking to fortify their existing skill set. By providing a holistic understanding of these essential languages, participants can lay a solid foundation for their future endeavors in the dynamic field of web development.      As we progress through the tutorial, we'll focus extensively on JavaScript, unraveling its intricacies in a manner accessible to beginners. The comprehensive nature of this tutorial makes it an id...

Display Battery Status using HTML, CSS and Javascript

     Hey everyone, welcome to Code Instinct! In this tutorial, we're going to show you how to create a battery status indicator using HTML, CSS and Javascript. This is a great Javascript project for beginners who want to learn how to use the Battery API Javascript and create a battery level indicator. We'll also be showing you how to add a battery charging animation and CSS battery shape to make it more visually appealing.Our tutorial will cover all the steps needed to create your own battery status indicator with ease. You'll learn how to use the Battery API Javascript to get the current battery level of your device, and display it using HTML and CSS.       We'll also be covering the different types of battery indicators you can use and how to customize them to fit your website design. You'll learn how to create a battery charging animation using Javascript and CSS to give your battery status indicator a more dynamic look.At Code Instinct, we're dedi...