Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ 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

Auto Save

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

              
                
	<section class="cd-fixed-background img-1" data-type="slider-item">
		<div class="cd-content">
			<h2>Title here</h2>
			<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Autem dolor beatae, laudantium eos fugiat, deserunt delectus quibusdam quae placeat, tempora ea? Nulla ducimus, magnam sunt repellendus modi, ad ipsam est.</p>
		</div>
	</section>

	<section class="cd-fixed-background img-2" data-type="slider-item">
		<div class="cd-content light-background">
			<h2>Title here</h2>
			<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Autem dolor beatae, laudantium eos fugiat, deserunt delectus quibusdam quae placeat, tempora ea? Nulla ducimus, magnam sunt repellendus modi, ad ipsam est.</p>
		</div>
	</section>

	<section class="cd-fixed-background img-3" data-type="slider-item">
		<div class="cd-content">
			<h2>Title here</h2>
			<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Autem dolor beatae, laudantium eos fugiat, deserunt delectus quibusdam quae placeat, tempora ea? Nulla ducimus, magnam sunt repellendus modi, ad ipsam est.</p>
		</div>
	</section>

	<section class="cd-fixed-background img-4" data-type="slider-item">
		<div class="cd-content">
			<h2>Title here</h2>
			<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Autem dolor beatae, laudantium eos fugiat, deserunt delectus quibusdam quae placeat, tempora ea? Nulla ducimus, magnam sunt repellendus modi, ad ipsam est.</p>
		</div>
	</section>
              
            
!

CSS

              
                /* -------------------------------- 

Primary style

-------------------------------- */
*, *::after, *::before {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

html {
  font-size: 62.5%;
}

body {
  font-size: 1.6rem;
  font-family: "Open Sans", sans-serif;
  color: #0f594d;
  background-color: #f2e6cd;
}
@media only screen and (min-width: 1048px) {
  body {
    /* hide horizontal scroll bar in IE */
    overflow-x: hidden;
  }
}

a {
  color: #93a748;
  text-decoration: none;
}

/* -------------------------------- 

xnugget info 

-------------------------------- */
.cd-nugget-info {
  text-align: center;
  position: absolute;
  width: 100%;
  height: 50px;
  line-height: 50px;
  top: 0;
  left: 0;
}
.cd-nugget-info a {
  position: relative;
  font-size: 14px;
  color: #0f594d;
  -webkit-transition: all 0.2s;
  -moz-transition: all 0.2s;
  transition: all 0.2s;
}
.no-touch .cd-nugget-info a:hover {
  opacity: .8;
}
.cd-nugget-info span {
  vertical-align: middle;
  display: inline-block;
}
.cd-nugget-info span svg {
  display: block;
}
.cd-nugget-info .cd-nugget-info-arrow {
  fill: #0f594d;
}

/* -------------------------------- 

xcarbonads 

-------------------------------- */
#carbonads-container,
#ui8ads-container {
  position: fixed;
  top: 40px;
  right: 3%;
  width: 180px;
  display: none;
  z-index: 5;
}
#carbonads-container .close-carbon-adv,
#carbonads-container .close-ui8-adv,
#ui8ads-container .close-carbon-adv,
#ui8ads-container .close-ui8-adv {
  display: inline-block;
  position: absolute;
  top: 0;
  right: 100%;
  background: rgba(15, 89, 77, 0.8);
  text-indent: 100%;
  overflow: hidden;
  width: 32px;
  height: 32px;
}
#carbonads-container .close-carbon-adv:hover,
#carbonads-container .close-ui8-adv:hover,
#ui8ads-container .close-carbon-adv:hover,
#ui8ads-container .close-ui8-adv:hover {
  background: #0f594d;
}
#carbonads-container .close-carbon-adv::after, #carbonads-container .close-carbon-adv::before,
#carbonads-container .close-ui8-adv::after,
#carbonads-container .close-ui8-adv::before,
#ui8ads-container .close-carbon-adv::after,
#ui8ads-container .close-carbon-adv::before,
#ui8ads-container .close-ui8-adv::after,
#ui8ads-container .close-ui8-adv::before {
  content: '';
  background-color: #fff;
  height: 2px;
  width: 14px;
  position: absolute;
  top: 14px;
  left: 9px;
}
#carbonads-container .close-carbon-adv::after,
#carbonads-container .close-ui8-adv::after,
#ui8ads-container .close-carbon-adv::after,
#ui8ads-container .close-ui8-adv::after {
  -webkit-transform: rotate(45deg);
  -moz-transform: rotate(45deg);
  -ms-transform: rotate(45deg);
  -o-transform: rotate(45deg);
  transform: rotate(45deg);
}
#carbonads-container .close-carbon-adv::before,
#carbonads-container .close-ui8-adv::before,
#ui8ads-container .close-carbon-adv::before,
#ui8ads-container .close-ui8-adv::before {
  -webkit-transform: rotate(-45deg);
  -moz-transform: rotate(-45deg);
  -ms-transform: rotate(-45deg);
  -o-transform: rotate(-45deg);
  transform: rotate(-45deg);
}
#carbonads-container .carbonad,
#carbonads-container .ui8ad,
#ui8ads-container .carbonad,
#ui8ads-container .ui8ad {
  background: rgba(255, 255, 255, 0.9);
  border: none;
  width: 100%;
  height: auto;
  padding: 14px;
  text-align: center;
  border-radius: 0 3px 3px 3px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}
#carbonads-container .carbonad .carbonad-image img,
#carbonads-container .carbonad .ui8ad-image img,
#carbonads-container .ui8ad .carbonad-image img,
#carbonads-container .ui8ad .ui8ad-image img,
#ui8ads-container .carbonad .carbonad-image img,
#ui8ads-container .carbonad .ui8ad-image img,
#ui8ads-container .ui8ad .carbonad-image img,
#ui8ads-container .ui8ad .ui8ad-image img {
  width: 130px;
}
#carbonads-container .carbonad .carbonad-image img,
#carbonads-container .ui8ad .carbonad-image img,
#ui8ads-container .carbonad .carbonad-image img,
#ui8ads-container .ui8ad .carbonad-image img {
  margin: 0 0 10px 10px;
}
#carbonads-container .carbonad .ui8ad-image img,
#carbonads-container .ui8ad .ui8ad-image img,
#ui8ads-container .carbonad .ui8ad-image img,
#ui8ads-container .ui8ad .ui8ad-image img {
  margin: 0 10px 10px;
  width: 130px;
}
#carbonads-container .carbonad .carbonad-text, #carbonads-container .carbonad .carbonad-tag,
#carbonads-container .carbonad .ui8ad-text, #carbonads-container .carbonad .ui8ad-tag,
#carbonads-container .ui8ad .carbonad-text,
#carbonads-container .ui8ad .carbonad-tag,
#carbonads-container .ui8ad .ui8ad-text,
#carbonads-container .ui8ad .ui8ad-tag,
#ui8ads-container .carbonad .carbonad-text,
#ui8ads-container .carbonad .carbonad-tag,
#ui8ads-container .carbonad .ui8ad-text,
#ui8ads-container .carbonad .ui8ad-tag,
#ui8ads-container .ui8ad .carbonad-text,
#ui8ads-container .ui8ad .carbonad-tag,
#ui8ads-container .ui8ad .ui8ad-text,
#ui8ads-container .ui8ad .ui8ad-tag {
  font-family: 'Helvetica Neue', Arial, sans-serif;
}
#carbonads-container .carbonad .carbonad-text,
#carbonads-container .carbonad .ui8ad-text,
#carbonads-container .ui8ad .carbonad-text,
#carbonads-container .ui8ad .ui8ad-text,
#ui8ads-container .carbonad .carbonad-text,
#ui8ads-container .carbonad .ui8ad-text,
#ui8ads-container .ui8ad .carbonad-text,
#ui8ads-container .ui8ad .ui8ad-text {
  display: block;
  width: 100%;
  padding: 0;
}
#carbonads-container .carbonad .carbonad-text a,
#carbonads-container .carbonad .ui8ad-text a,
#carbonads-container .ui8ad .carbonad-text a,
#carbonads-container .ui8ad .ui8ad-text a,
#ui8ads-container .carbonad .carbonad-text a,
#ui8ads-container .carbonad .ui8ad-text a,
#ui8ads-container .ui8ad .carbonad-text a,
#ui8ads-container .ui8ad .ui8ad-text a {
  color: #93a748;
  font-size: 13px;
  font-weight: bold;
}
.no-touch #carbonads-container .carbonad .carbonad-text a:hover, .no-touch
#carbonads-container .carbonad .ui8ad-text a:hover, .no-touch
#carbonads-container .ui8ad .carbonad-text a:hover, .no-touch
#carbonads-container .ui8ad .ui8ad-text a:hover, .no-touch
#ui8ads-container .carbonad .carbonad-text a:hover, .no-touch
#ui8ads-container .carbonad .ui8ad-text a:hover, .no-touch
#ui8ads-container .ui8ad .carbonad-text a:hover, .no-touch
#ui8ads-container .ui8ad .ui8ad-text a:hover {
  text-decoration: underline;
}
#carbonads-container .carbonad .carbonad-tag,
#carbonads-container .carbonad .ui8ad-tag,
#carbonads-container .ui8ad .carbonad-tag,
#carbonads-container .ui8ad .ui8ad-tag,
#ui8ads-container .carbonad .carbonad-tag,
#ui8ads-container .carbonad .ui8ad-tag,
#ui8ads-container .ui8ad .carbonad-tag,
#ui8ads-container .ui8ad .ui8ad-tag {
  margin-top: 5px;
  color: #0f594d;
}
#carbonads-container .carbonad .carbonad-tag a,
#carbonads-container .carbonad .ui8ad-tag a,
#carbonads-container .ui8ad .carbonad-tag a,
#carbonads-container .ui8ad .ui8ad-tag a,
#ui8ads-container .carbonad .carbonad-tag a,
#ui8ads-container .carbonad .ui8ad-tag a,
#ui8ads-container .ui8ad .carbonad-tag a,
#ui8ads-container .ui8ad .ui8ad-tag a {
  color: #0f594d;
}
#carbonads-container .carbonad .carbonad-tag a:hover,
#carbonads-container .carbonad .ui8ad-tag a:hover,
#carbonads-container .ui8ad .carbonad-tag a:hover,
#carbonads-container .ui8ad .ui8ad-tag a:hover,
#ui8ads-container .carbonad .carbonad-tag a:hover,
#ui8ads-container .carbonad .ui8ad-tag a:hover,
#ui8ads-container .ui8ad .carbonad-tag a:hover,
#ui8ads-container .ui8ad .ui8ad-tag a:hover {
  color: #93a748;
}
#carbonads-container .carbonad .ui8ad-tag,
#carbonads-container .ui8ad .ui8ad-tag,
#ui8ads-container .carbonad .ui8ad-tag,
#ui8ads-container .ui8ad .ui8ad-tag {
  display: inline-block;
  font-size: 11px;
  line-height: 15px;
}
@media only screen and (min-width: 1048px) {
  #carbonads-container,
  #ui8ads-container {
    display: block;
  }
}

/* -------------------------------- 

Main Components 

-------------------------------- */
.cd-header {
  position: relative;
  height: 100%;
  background-color: #93a748;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  z-index: 1;
}
.cd-header h1 {
  width: 90%;
  color: #f2e6cd;
  text-align: center;
  font-size: 2.2rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: absolute;
  left: 50%;
  top: 50%;
  bottom: auto;
  right: auto;
  -webkit-transform: translateX(-50%) translateY(-50%);
  -moz-transform: translateX(-50%) translateY(-50%);
  -ms-transform: translateX(-50%) translateY(-50%);
  -o-transform: translateX(-50%) translateY(-50%);
  transform: translateX(-50%) translateY(-50%);
}
@media only screen and (min-width: 768px) {
  .cd-header h1 {
    font-size: 3.6rem;
    font-weight: 300;
  }
}

.cd-fixed-background {
  position: relative;
  padding: 3em 5% 0;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center center;
}
.cd-fixed-background h2, .cd-fixed-background p {
  color: #f2e6cd;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.cd-fixed-background h2 {
  font-size: 2.4rem;
  margin-bottom: 1em;
}
.cd-fixed-background p {
  line-height: 1.6;
  font-family: "Merriweather", serif;
}
.cd-fixed-background .light-background h2, .cd-fixed-background .light-background p {
  color: #0f594d;
}
.cd-fixed-background .cd-content::after {
  /* phone image on small devices */
  content: '';
  display: block;
  width: 100%;
  padding: 60% 0;
  margin: 2em auto 0;
}
.cd-fixed-background.img-1 {
  background-color: #bf5138;
}
.cd-fixed-background.img-1 .cd-content::after {
  background: url("https://codyhouse.co/demo/fixed-background-effect/img/img-mobile-1.jpg") no-repeat;
  background-size: 100% auto;
}
.cd-fixed-background.img-2 {
  background-color: #f2e6cd;
}
.cd-fixed-background.img-2 .cd-content::after {
  background: url("https://codyhouse.co/demo/fixed-background-effect/img/img-mobile-2.jpg") no-repeat;
  background-size: 100% auto;
}
.cd-fixed-background.img-3 {
  background-color: #0f594d;
}
.cd-fixed-background.img-3 .cd-content::after {
  background: url("https://codyhouse.co/demo/fixed-background-effect/img/img-mobile-3.jpg") no-repeat;
  background-size: 100% auto;
}
.cd-fixed-background.img-4 {
  background-color: #db9537;
}
.cd-fixed-background.img-4 .cd-content::after {
  background: url("https://codyhouse.co/demo/fixed-background-effect/img/img-mobile-4.jpg") no-repeat;
  background-size: 100% auto;
}
@media only screen and (min-width: 768px) {
  .cd-fixed-background {
    height: 100%;
    padding: 0;
  }
  .cd-fixed-background h2 {
    font-size: 3.6rem;
    font-weight: 300;
  }
  .cd-fixed-background p {
    font-size: 1.8rem;
    line-height: 1.8;
  }
  .cd-fixed-background .cd-content {
    width: 50%;
    position: absolute;
    left: 5%;
    top: 50%;
    bottom: auto;
    -webkit-transform: translateY(-50%);
    -moz-transform: translateY(-50%);
    -ms-transform: translateY(-50%);
    -o-transform: translateY(-50%);
    transform: translateY(-50%);
  }
  .cd-fixed-background .cd-content::after {
    display: none !important;
  }
  .cd-fixed-background.img-1 {
    background-image: url("https://codyhouse.co/demo/fixed-background-effect/img/img-1.jpg");
  }
  .cd-fixed-background.img-2 {
    background-image: url("https://codyhouse.co/demo/fixed-background-effect/img/img-2.jpg");
  }
  .cd-fixed-background.img-3 {
    background-image: url("https://codyhouse.co/demo/fixed-background-effect/img/img-3.jpg");
  }
  .cd-fixed-background.img-4 {
    background-image: url("https://codyhouse.co/demo/fixed-background-effect/img/img-4.jpg");
  }
}
@media only screen and (min-width: 1048px) {
  .cd-fixed-background {
    background-attachment: fixed;
  }
  .cd-fixed-background .cd-content {
    width: 40%;
    left: 10%;
  }
}

.cd-vertical-nav {
  position: fixed;
  z-index: 2;
  right: 3%;
  top: 50%;
  bottom: auto;
  -webkit-transform: translateY(-50%);
  -moz-transform: translateY(-50%);
  -ms-transform: translateY(-50%);
  -o-transform: translateY(-50%);
  transform: translateY(-50%);
  display: none;
}
.cd-vertical-nav a {
  display: block;
  height: 40px;
  width: 40px;
  /* image replace */
  overflow: hidden;
  text-indent: 100%;
  white-space: nowrap;
  background: transparent url(../img/cd-icon-arrow.svg) no-repeat center center;
  -webkit-transition: opacity 0.2s 0s, visibility 0.2s 0s;
  -moz-transition: opacity 0.2s 0s, visibility 0.2s 0s;
  transition: opacity 0.2s 0s, visibility 0.2s 0s;
}
.cd-vertical-nav a.cd-prev {
  -webkit-transform: rotate(180deg);
  -moz-transform: rotate(180deg);
  -ms-transform: rotate(180deg);
  -o-transform: rotate(180deg);
  transform: rotate(180deg);
  margin-bottom: 10px;
}
.cd-vertical-nav a.inactive {
  visibility: hidden;
  opacity: 0;
  -webkit-transition: opacity 0.2s 0s, visibility 0s 0.2s;
  -moz-transition: opacity 0.2s 0s, visibility 0s 0.2s;
  transition: opacity 0.2s 0s, visibility 0s 0.2s;
}
@media only screen and (min-width: 1200px) {
  .cd-vertical-nav {
    display: block;
  }
}

.no-js .cd-vertical-nav {
  display: none;
}

              
            
!

JS

              
                
              
            
!
999px

Console