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

              
                  <div class="fixed-body">
   <section>
    <h2>Dog</h2>
     <p>Basking in the breeze, the dog inside the car wears a contented expression as it leans out the window. Ears aflutter, and with its fur ruffling in the wind, it embraces the exhilarating sensation of the open road. A picture of pure joy and freedom.</p>
   </section>
   <div class="fixed-block photo1"></div>
   <section>
    <h2>Watr</h2>
     <p>The tranquil lake stretched as far as the eye could see, its surface glistening under the sun's gentle caress. Crystal-clear droplets cascaded from the waterfall, landing in a cool, inviting pool below. Waves danced and whispered along the shoreline, while rain tapped a soothing rhythm on windowsills. Water, in its various forms, always held a mesmerizing and calming allure.</p>
   </section>
   <div class="fixed-block photo2"></div>
   <section>
    <h2>Tokyo Skytree</h2>
     <p>As the sun bids its farewell, Tokyo's Skytree emerges against the canvas of the evening sky, its silhouette bathed in the warm hues of twilight. The city lights awaken, casting a gentle glow, while the tower stands tall, a sentinel of the night, offering a breathtaking spectacle.</p>
   </section>
   <div class="fixed-block photo3"></div>
   <div class="footer">©yamada3004.</div>
  </div>
              
            
!

CSS

              
                *,
*:before,
*:after {
	margin: 0;
	padding: 0;
 box-sizing: border-box;
}
.fixed-body section {
  background-color: #eeeeee;
  width: 100%;
  height: 50vh;
  padding: 2rem;
  			position: relative;
			overflow: hidden;
			&::after {
				content: '';
				position: absolute;
				top: 0;
				left: 0;
				z-index: 1;
				display: block;
				width: 100%;
				height: 100%;
				transition: 1s;
				background: linear-gradient( to bottom, transparent 0%,#eeeeee 100% );
			}
}
.fixed-body section h2 {
  color: #000;
  font-size: 80px;
  text-transform: uppercase;
  word-wrap:break-word;
}
.fixed-body section p{
	color: #000;
	line-height: 1.8;
	max-width: 70%;
  margin-top: clamp(24px, 3.1vw ,32px);
}
.fixed-body .footer {
  background-color: #eeeeee;
  width: 100%;
  height: 30vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
}
/* ここから画像固定 */
.fixed-block {
  min-height: 35vh;
  position: relative;
  background-position: top center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-size: cover;
}
.fixed-block.photo1 {
  background-image: url(https://css.pieceplus.jp/wp-content/uploads/2023/08/001.jpg);
}
.fixed-block.photo2 {
  background-image: url(https://css.pieceplus.jp/wp-content/uploads/2023/08/002.jpg);
}
.fixed-block.photo3 {
  background-image: url(https://css.pieceplus.jp/wp-content/uploads/2023/08/003.jpg);
}
              
            
!

JS

              
                
              
            
!
999px

Console