cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

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.

Quick-add: + add another resource

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.

Quick-add: + add another resource

Code Indentation

     

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.

            
              <main>
    <div class="fixed-bg bg-1">
        <h1>Fixed Background Effect <span>(keep scrolling)</span></h1>
    </div> 
 
    <div class="scroll-bg color-2">
        <div class="container">
            <p>
                Ille vivere. Ut ad te quaerebam ... purgare caeli. Sunt uh ... nonnullus propter errorem qui de rebus inter nos et iacere puto suus in causa, id est in mensa. Levir meus, priusquam oppugnarent tempus quis, admonere dicitur. Credo quod idem mihi praesidium.
            </p>

              <p>
                  Suspicio? Bene ... tunc ibimus? Quis uh ... CONEXUS locus his diebus? Quisque semper aliquid videtur, in volutpat mauris. Nolo enim dicere. Vobis neque ab aliis. Ego feci memetipsum explicans. Gus mortuus est. Lorem opus habeo. 
            </p>
        </div> 
    </div> 
  
    <div class="fixed-bg bg-2">
      <h1>Another Fixed Background</h1>
    </div> 
  
  <div class="scroll-bg color-1">
        <div class="container">
            <p>
                Paenitet me quod tu me rogas? Oh, sic, qui stultus plastic continentis rogavi te ut emas. Vides non manducare acidum hydrofluoric per plastic. Erit autem dissolvere metalli petram, vitrum, tellus. Ita quod illic '. Quam de aliquo cum aliqua interdum, maybe? Aliquid viride, huh? Quam vos sunt etiam vivere? 
            </p>
        </div> 
    </div> 
</main>
            
          
!
            
              /*All photos from https://placeimg.com*/

html {
  font-size: 13px;
  /* sets the base font to 10px for easier math */
  
  @media screen and (min-width: 500px) {
    font-size: 14px;
  }
   @media screen and (min-width: 570px) {
    font-size: 15px;
  }
   @media screen and (min-width: 620px) {
    font-size: 16px;
  }
   @media screen and (min-width: 680px) {
    font-size: 17px;
  }
   @media screen and (min-width: 720px) {
    font-size: 18px;
  }
   @media screen and (min-width: 800px) {
    font-size: 19px;
  }
   @media screen and (min-width: 860px) {
    font-size: 20px;
  }
   @media screen and (min-width: 920px) {
    font-size: 21px;
  }
   @media screen and (min-width: 1000px) {
    font-size: 22px;
  }
}

body {
  font-size: 1rem;
  /* sets the default sizing to make sure nothing is actually 10px */
}

h1 {
  font-size: 32px;
  font-size: 3.2rem;
}

span {
  font-size: 24px;
  font-size: 2.4rem;
}

body, html, main {
  height: 100%;
  position: relative;
  z-index: 1;
}

h1 {
  font-family: 'Muli', sans-serif;
}

p {
  line-height: 1.8;
  font-family: 'Montserrat', sans-serif;
  color: #1A1A1A;
}
.fixed-bg.bg-1 {
  background-image: url(https://placeimg.com/1000/500/nature);
}

.fixed-bg.bg-2 {
  background-image: url(https://placeimg.com/1000/500/arch);
}

.fixed-bg {
  position: relative;
  min-height: 100%;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center center;
  z-index: 1;
  background-attachment: scroll;
/*  Don't fix background on smaller screens*/
  
  @media screen and (min-width: 40em ) {
    background-attachment: fixed;
   /* Fixed background only on bigger screens*/
  }
}

.scroll-bg {
  position: relative;
/*  min-height: 100%;*/
  padding: 4em 0;
  line-height: 1.6;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
  z-index: 2;
}

.scroll-bg.color-2 {
  background-color: lighten(#208075, 20%);
}

.scroll-bg.color-1 {
  background-color: #ABACAB;
}

.container {
  width: 90%;
  max-width: 768px;
  margin: 0 auto;
  
   &:after {
  /* clearfix */
  content: '';
  display: table;
  clear: both;
  }
}

.fixed-bg h1 {
  position: absolute;
  top: 50%;
  left: 50%;
  bottom: auto;
  right: auto;
  color: white;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  transform: translateX(-50%) translateY(-50%);
  line-height: 1;
  
 /* @media (min-width: 40em) {
    font-size: 4.8rem;
  }*/
}
            
          
!
999px
Loading ..................

Console