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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

              
                <div id="container">
	<section>
		<div class="box box1"></div>
		<div class="box text1">Stack Overflow est un  site web proposant des questions et réponses sur un large choix de thèmes concernant la programmation informatique.</div>
	</section>
	
	<section>
		<div class="box box2"></div>
		<div class="box text2">OpenClassrooms est un site web de formation en ligne qui propose à ses membres des cours certifiants et des parcours débouchant sur des métiers en croissance.</div>
	</section>
</div>
              
            
!

CSS

              
                #container {
	max-width: 800px;
	margin: auto;
}

/* Clearfix */
section::after {
	content: '';
	clear: both;
	display: block;
}

.box {
	width: 400px;
	height: 400px;
	float: left;
	font-size: 25px;
	will-change: transform, opacity;
}
.box1 {
	background-image: url("https://cdn.sstatic.net/Sites/stackoverflow/img/404.svg");
}
.box2 {
	background-image: url("https://openclassrooms.com/images/error/error_404.svg");
	width: 500px;
	height: 348px;
}
.text2 {
	width: 300px;
}


/* styling just for demo */
section { margin: 60vh 0; }

              
            
!

JS

              
                gsap.utils.toArray("section").forEach(section => {
	const boxes = section.querySelectorAll(".box");
	const tl = gsap.timeline({
		scrollTrigger: {
			trigger: section,
			start: "top center",
			end: "bottom top",
			markers: true,
			toggleActions: "play none none reverse"
		},
		defaults: {
			duration: 1,
			opacity: 0,
			ease: "power2"
		}
	})
	.from(boxes[0], { x: "-100vw" })
	.from(boxes[1], { x:  "100vw" }, 0);
});

              
            
!
999px

Console