HTML preprocessors can make writing HTML more powerful or convenient. For instance, Markdown is designed to be easier to write and read for text documents and you could write a loop in Pug.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. So you don't have access to higher-up elements like the <html>
tag. If you want to add classes there that can affect the whole document, this is the place to do it.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. If you need things in the <head>
of the document, put that code here.
The resource you are linking to is using the 'http' protocol, which may not work when the browser is using https.
CSS preprocessors help make authoring CSS easier. All of them offer things like variables and mixins to provide convenient abstractions.
It's a common practice to apply CSS to a page that styles elements such that they are consistent across all browsers. We offer two of the most popular choices: normalize.css and a reset. Or, choose Neither and nothing will be applied.
To get the best cross-browser support, it is a common practice to apply vendor prefixes to CSS properties and values that require them to work. For instance -webkit-
or -moz-
.
We offer two popular choices: Autoprefixer (which processes your CSS server-side) and -prefix-free (which applies prefixes via a script, client-side).
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.
You can apply CSS to your Pen from any stylesheet on the web. Just put a URL to it here and we'll apply it, in the order you have them, before the CSS in the Pen itself.
You can also link to another Pen here (use the .css
URL Extension) and we'll pull the CSS from that Pen and include it. If it's using a matching preprocessor, use the appropriate URL Extension and we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
JavaScript preprocessors can help make authoring JavaScript easier and more convenient.
Babel includes JSX processing.
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.
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.
If the script you link to has the file extension of a preprocessor, we'll attempt to process it before applying.
You can also link to another Pen here, and we'll pull the JavaScript from that Pen and include it. If it's using a matching preprocessor, we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
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.
Using packages here is powered by esm.sh, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ESM usage.
All packages are different, so refer to their docs for how they work.
If you're using React / ReactDOM, make sure to turn on Babel for the JSX processing.
If active, Pens will autosave every 30 seconds after being saved once.
If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.
If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.
Visit your global Editor Settings.
<main class="main">
<section class="section" id="intro">
<div class="container">
<h1 class="animonItem">左からフェードイン</h1>
<p class="animonItem" data-delay="200">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
</section>
<section class="section" id="FadeInRight">
<div class="container">
<h1 class="animonItem" data-effect="fadeInRight" data-duration="4s">右からフェードイン</h1>
<p class="animonItem" data-effect="fadeInRight" data-delay="200" data-duration="4s">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
</section>
<section class="section" id="ScaleUp">
<div class="container">
<h1 class="animonItem" data-effect="scaleUp">アニメーション+拡大</h1>
<p class="animonItem" data-delay="200" data-effect="scaleUp">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
</section>
<section class="section" id="ScaleDown">
<div class="container">
<h1 class="animonItem" data-effect="scaleDown">アニメーション+縮小</h1>
<p class="animonItem" data-effect="scaleDown" data-delay="400">Nulla pharetra diam sit amet nisl suscipit adipiscing. Nec sagittis aliquam malesuada bibendum. Sed egestas egestas fringilla phasellus faucibus scelerisque. Sapien faucibus et molestie ac feugiat sed lectus. Varius sit amet mattis vulputate enim nulla. Adipiscing vitae proin sagittis nisl. Diam ut venenatis tellus in metus vulputate eu scelerisque. Pellentesque eu tincidunt tortor aliquam nulla.</p>
</div>
</section>
<section class="section" id="FadeIn">
<div class="container">
<h1 class="animonItem" data-effect="fadeIn">フェードイン</h1>
<p class="animonItem" data-effect="fadeIn" data-delay="200">Orci ac auctor augue mauris augue neque gravida in. Euismod elementum nisi quis eleifend quam adipiscing vitae proin sagittis. Mattis molestie a iaculis at erat. Et tortor at risus viverra. Ac odio tempor orci dapibus ultrices in. At lectus urna duis convallis convallis tellus. Aliquet eget sit amet tellus cras adipiscing. Sit amet est placerat in egestas erat. Augue ut lectus arcu bibendum at varius vel pharetra vel. Nunc sed id semper risus in hendrerit gravida rutrum. Dolor sed viverra ipsum nunc aliquet bibendum enim facilisis.</p>
</div>
</section>
<section class="section" id="FadeInDown">
<div class="container">
<h1 class="animonItem" data-effect="fadeInDown" data-delay="200">フェードインダウン</h1>
<p class="animonItem" data-effect="fadeInDown">Magna etiam tempor orci eu lobortis elementum nibh tellus molestie. Ut sem nulla pharetra diam sit amet nisl suscipit. Feugiat nisl pretium fusce id velit ut tortor pretium viverra. Nam at lectus urna duis convallis convallis. Ut sem nulla pharetra diam sit amet nisl suscipit. Id ornare arcu odio ut sem nulla. Etiam dignissim diam quis enim lobortis scelerisque fermentum dui. Imperdiet sed euismod nisi porta lorem mollis aliquam ut porttitor. Eget arcu dictum varius duis. Accumsan sit amet nulla facilisi.</p>
</div>
</section>
<section class="section" id="FadeInUp">
<div class="container">
<h1 class="animonItem" data-effect="fadeInUp">フェードインアップ</h1>
<p class="animonItem" data-effect="fadeInUp" data-delay="200">Nisl suscipit adipiscing bibendum est ultricies integer quis auctor elit. Ornare lectus sit amet est placerat in egestas erat. Tristique nulla aliquet enim tortor. Non odio euismod lacinia at. Vestibulum morbi blandit cursus risus at. Orci eu lobortis elementum nibh tellus molestie nunc non blandit. Porta non pulvinar neque laoreet suspendisse interdum consectetur.</p>
</div>
</section>
</main>
html {
box-sizing: border-box;
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
text-rendering: optimizeLegibility;
text-size-adjust: 100%;
scroll-behavior: smooth;
overflow-x: hidden;
}
*,
*:before,
*:after {
box-sizing: inherit;
padding: 0;
margin: 0;
}
body {
font-size: 100%;
line-height: 1.48;
background-color: #f2f2f2;
}
.container {
width: 60rem;
max-width: 88%;
margin: 0 auto;
}
.section {
height: 100vh;
display: flex;
flex-direction: column;
justify-content: center;
align-items: flex-start;
padding: 2rem 0;
}
.section:nth-of-type(2) {
color: #ffffff;
background-color: red;
}
.section:nth-of-type(3) {
background-color: green;
}
.section:nth-of-type(4) {
background-color: yellow;
}
.section:nth-of-type(5) {
background-color: pink;
}
.section:nth-of-type(6) {
color: #ffffff;
background-color: blue;
}
.section h1 {
font-size: 4rem;
font-weight: 900;
}
.section p {
font-size: 1.5rem;
}
.footer {
padding: 2rem 0;
color: #aaaaaa;
background-color: #000000;
}
Save
Animon.animon();
Also see: Tab Triggers