Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">

<body>
  <div class="headImage">
    <div class="logo">
    </div>
  <div class="title">
     <div class="box">
       <img src="https://cdn.onlinewebfonts.com/svg/img_59033.png" alt="Italian Trulli" style="width: 100px">
       <h1> Parallax Coffeeshop </h1>
       <p class="p"> Scroll down to see effect </p>
       <button class="navBtn"> Menu
    </button>
    <button class="navBtn"> Store
    </button>
     <button class="navBtn"> Order
    </button>
        </div>
  </div>
</div>
<!--   <section class="section2 section-dark">
  <h3 style="text-transform:uppercase"> Our Coffee Origins </h3>
    <p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque </p>
    </section> -->
  <!-- SECTION 1 -->
<div class="image1">
  <div class="title">
    <span class="border">
     Parallax Image 1
    </span>
  </div>
</div>

<section class="section section-dark">
  <h2> Where we get our coffee </h2>
  <p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? </p>
</section>

<!-- SECTION 2 -->

<div class="image2">
  <div class="title">
    <span class="border">
    Parallax Image 2 
    </span>
  </div>
</div>

<section class="section section-light">
  <h3> Fair trade practices </h3>
  <p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? </p>
</section>

<!-- SECTION 3 -->

<div class="image3">
  <div class="title">
   <span class="border">
  Parallax Image 3 
     </span>
  </div>
</div>

<section class="section section-dark">
  <h3> Hand selected beans </h3>
  <p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? </p>
</section>

<!--  Scroll back to top button   -->
  
<button onclick="topFunction()" id="myBtn" title="Go to top">&uarr;</button>
  
<!-- FOOTER ATTRIBUTIONS -->
<div class="footer">
  <a href="#" class="fa fa-facebook"></a>
  <a href="#" class="fa fa-twitter"></a>
  <a href="#" class="fa fa-instagram"></a>
  
  <p style="font-size: 0.7rem;text-align: center; "><a href="https://www.flickr.com/photos/51469178@N06/10765000233">"Coffee Farms and Processing, Kerinci, Sumatra, Indonesia"</a><span> by <a href="https://www.flickr.com/photos/51469178@N06">Wild Sumatra https://www.wildsumatra.com</a></span> is licensed under <a href="https://creativecommons.org/licenses/by-nc-sa/2.0/?ref=ccsearch&atype=html" style="text-align: center">CC BY-NC-SA 2.0</a><a href="https://creativecommons.org/licenses/by-nc-sa/2.0/?ref=ccsearch&atype=html" target="_blank" rel="noopener noreferrer" style="text-align: center; display: inline-block;white-space: none;margin-top: 2px;margin-left: 3px;height: 22px !important;"></a></p>
  </div>
  
</body>
              
            
!

CSS

              
                body, html{
  height:100%;
  margin:0;
  font-size:16px;
  font-weight:400;
  line-height:1.7em;
  color:gray;
  font-family: "Gill Sans", sans-serif
}


/* -------------------Image Styling for parallax effect */
.headImage, .image1, .image2, .image3{
  position:relative;
  opacity: .80;
  background-position:center;
  background-size:cover;
  background-repeat:no-repeat;
  background-attachment:fixed;
}

.headImage{
  background-image:url(https://live.staticflickr.com/4051/4341686106_4822b2ca1e_b.jpg);
  min-height:100%;
}

.image1{
  background-image:url(https://live.staticflickr.com/5109/5622680022_a4fbd51e10_b.jpg);
  min-height:110%;
}

.image2{
  background-image:url(https://live.staticflickr.com/5499/10764839034_fa4247cd87_b.jpg);
  min-height:100%;
}

.image3{
  background-image:url(https://live.staticflickr.com/3783/10765047863_3ef40ce29b_b.jpg);
  min-height:100%;
}

/* -------------------Text Styling */
.section{
  text-align: center;
  padding:50px 80px;
}

.section2{
  text-align: center;
  padding:5px 10px;
  letter-spacing:8px;
}

.section-light{
  background-color:#f4f4f4;
  color:gray;
}

.section-dark{
  background-color:#282e34;
  color: #ddd;
}

.title{
  position:absolute;
  top:25%;
  width:100%;
  text-align:center;
  color:#000;
  font-size:20pt;
  letter-spacing:8px;
  text-transform:uppercase;
  line-height:40pt
}

.border{
  background-color:white;
  padding: 20px;
  opacity: .7;
}

.box{
  background-color: white;
  opacity:.7;
  min-height:500px;
  padding:20px;
  overflow: hidden;
}
h1 {
  opacity:1;
}
/* ------------------- Scroll back to top button */
#myBtn {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 30px;
  z-index: 99;
  font-size: 18px;
  border: none;
  outline: none;
  background-color: #669900;
  color: white;
  cursor: pointer;
  padding: 15px;
  border-radius: 15px;
  opacity: .75;
}

#myBtn:hover {
  background-color: #555;
}

.navBtn {
  font-size: 18px;
   display: inline-block;
  text-decoration: none;
  color: white;
  font-weight: 700;
  background: #97d16d;
  padding: 0.5em 2em;
  border-radius: 40px;
  margin: 1em 0;
  transition: 0.3s;
}

.action-btn:hover {
  box-shadow: 0 10px 50px rgba(188, 197, 216, 1);
}

.navBtn:hover {
  color:white;
  background-color:#330d00;
  box-shadow: 0 10px 50px rgba(188, 197, 216, 1);
}

/* Footer */
.footer {
  left: 0;
  bottom: 0;
  width: 100%;
  background-color: black;
  color: white;
  text-align: center;
  padding: 5px;
  letter-spacing: 0.2em;
}

a {
  color: white;
}

.fa {
  padding: 20px;
  font-size: 30px;
  width: 10px;
  text-align: center;
  text-decoration: none;
  border-radius: 50%;
}

/* ------------------- Responsive settings */
@media(max-width:568px){
/*   .image1,.image2,.image3, .headImage{
    background-attachment:scroll
  } */
  .title h1{
     font-size:15pt;
  }
}

@media(max-height:568px){
/*   .image1,.image2,.image3, .headImage{
    background-attachment:scroll
  } */
  h1 {
    font-size:14pt;
    line-height:20pt
  }
  .p {
    font-size:10pt;
    line-height:20pt
  }
}

              
            
!

JS

              
                //Get the Scroll back to top button
var mybutton = document.getElementById("myBtn");

// When the user scrolls down 20px from the top of the document, show the button
window.onscroll = function() {scrollFunction()};

function scrollFunction() {
  if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
    mybutton.style.display = "block";
  } else {
    mybutton.style.display = "none";
  }
}

// When the user clicks on the button, scroll to the top of the document
function topFunction() {
  document.body.scrollTop = 0;
  document.documentElement.scrollTop = 0;
}
              
            
!
999px

Console