Facebook
From Walloping Crocodile, 4 Days ago, written in HTML5.
Embed
Download Paste or View Raw
Hits: 42
  1. <!DOCTYPE html>
  2. <meta name="viewport" content="width=device-width, initial-scale=1">
  3. body, html {
  4.   height: 100%;
  5.   margin: 0;
  6.   font: 400 15px/1.8 "Lato", sans-serif;
  7.   color: #777;
  8. }
  9.  
  10. .bgimg-1, .bgimg-2, .bgimg-3 {
  11.   position: relative;
  12.   opacity: 0.65;
  13.   background-attachment: fixed;
  14.   background-position: center;
  15.   background-repeat: no-repeat;
  16.   background-size: cover;
  17.  
  18. }
  19. .bgimg-1 {
  20.   background-image: url("media/Mountain-3.jpg");
  21.   min-height: 100%;
  22. }
  23.  
  24. .bgimg-2 {
  25.   background-image: url("media/mountains-hero.jpg");
  26.   min-height: 400px;
  27. }
  28.  
  29. .bgimg-3 {
  30.   background-image: url("media/penisgory.jpg");
  31.   min-height: 400px;
  32. }
  33.  
  34. .caption {
  35.   position: absolute;
  36.   left: 0;
  37.   top: 50%;
  38.   width: 100%;
  39.   text-align: center;
  40.   color: #000;
  41. }
  42.  
  43. .caption span.border {
  44.   background-color: #111;
  45.   color: #fff;
  46.   padding: 18px;
  47.   font-size: 25px;
  48.   letter-spacing: 10px;
  49. }
  50.  
  51. h3 {
  52.   letter-spacing: 5px;
  53.   text-transform: uppercase;
  54.   font: 20px "Lato", sans-serif;
  55.   color: #111;
  56. }
  57.  
  58. /* Turn off parallax scrolling for tablets and phones */
  59. @media only screen and (max-device-width: 1024px) {
  60.     .bgimg-1, .bgimg-2, .bgimg-3 {
  61.         background-attachment: scroll;
  62.     }
  63. }
  64. </head>
  65.  
  66. <div class="bgimg-1">
  67.   <div class="caption">
  68.     <span class="border">SCROLL DOWN</span>
  69.   </div>
  70. </div>
  71.  
  72. <div style="color: #777;background-color:white;text-align:center;padding:50px 80px;text-align: justify;">
  73.   <h3 style="text-align:center;">Parallax Demo</h3>
  74.   <p>Parallax scrolling is a web site trend where the background content is moved at a different speed than the foreground content while scrolling. Nascetur per nec posuere turpis, lectus nec libero turpis nunc at, sed posuere mollis ullamcorper libero ante lectus, blandit pellentesque a, magna turpis est sapien duis blandit dignissim. Viverra interdum mi magna mi, morbi sociis. Condimentum dui ipsum consequat morbi, curabitur aliquam pede, nullam vitae eu placerat eget et vehicula. Varius quisque non molestie dolor, nunc nisl dapibus vestibulum at, sodales tincidunt mauris ullamcorper, dapibus pulvinar, in in neque risus odio. Accumsan fringilla vulputate at quibusdam sociis eleifend, aenean maecenas vulputate, non id vehicula lorem mattis, ratione interdum sociis ornare. Suscipit proin magna cras vel, non sit platea sit, maecenas ante augue etiam maecenas, porta porttitor placerat leo.</p>
  75. </div>
  76.  
  77. <div class="bgimg-2">
  78.   <div class="caption">
  79.     <span class="border" style="background-color:transparent;font-size:25px;color: #f7f7f7;">LESS HEIGHT</span>
  80.   </div>
  81. </div>
  82.  
  83. <div style="position:relative;">
  84.   <div style="color:#ddd;background-color:#282E34;text-align:center;padding:50px 80px;text-align: justify;">
  85.     <p>Scroll up and down to really get the feeling of how Parallax Scrolling works.</p>
  86.   </div>
  87. </div>
  88.  
  89. <div class="bgimg-3">
  90.   <div class="caption">
  91.     <span class="border" style="background-color:transparent;font-size:25px;color: #f7f7f7;">SCROLL UP</span>
  92.   </div>
  93. </div>
  94.  
  95. <div style="position:relative;">
  96.   <div style="color:#ddd;background-color:#282E34;text-align:center;padding:50px 80px;text-align: justify;">
  97.     <p>Scroll up and down to really get the feeling of how Parallax Scrolling works.</p>
  98.   </div>
  99. </div>
  100.  
  101. <div class="bgimg-1">
  102.   <div class="caption">
  103.     <span class="border">COOL!</span>
  104.   </div>
  105. </div>
  106.  
  107. </body>
  108. </html>