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.
<!--
For CSS Grid expertise:
Rachel Andrew: https://gridbyexample.com/
Jen Simmons: http://labs.jensimmons.com/
-->
<div id="holder">
<h1>CSS Grid<br>experiment in three planes</h1>
<p class="leon">Okay if I talk?</p>
<p class="leon">I kinda get nervous when I take tests.</p>
<p class="leon">Sorry.</p>
<p class="leon">I already had an I.Q. test this year... but I don't think I ever had a...</p>
<p class="leon">Uh... sure...</p>
<p class="leon">Oh... that's the hotel.</p>
<p class="leon">Where I live.</p>
<p class="leon">Huh? Sure. Yeah. I guess. Is that...part of the test?</p>
<p class="leon">Oh. it's not fancy or anything.</p>
<p class="leon">Is this the test now?</p>
<p class="leon">What one?</p>
<p class="leon">What desert?</p>
<p class="leon">But how come I'd be there?</p>
<p class="leon">A tortoise. What's that?</p>
<p class="leon">Of course.</p>
<p class="leon">I never seen a turtle.</p>
<p class="leon">But I understand what you mean.</p>
<p class="leon">You make up these questions, Mr. Holden, or do they write 'em down for you?</p>
<p class="leon">Whatya means, I'm not helping?</p>
<p class="leon">My mother... <br>I'll tell you about my mother.</p>
<p class="holden">Don't move.</p>
<p class="holden">Reaction time is a factor in this so please pay attention. Answer as quickly as you can.</p>
<p class="holden">One one eight seven at Hunterwasser...</p>
<p class="holden">What?</p>
<p class="holden">Nice place?</p>
<p class="holden">Warming you up, that's all.</p>
<p class="holden">You're in a desert, walking along in the sand when...</p>
<p class="holden">Yes. You're in a desert, walking along in the sand when all of a sudden you look down and see a...</p>
<p class="holden">What?</p>
<p class="holden">Doesn't make any difference what desert... its completely hypothetical.</p>
<p class="holden">Maybe you're fed up, maybe you want to be by yourself...who knows. So you look down and see a tortoise. It's crawling toward you...</p>
<p class="holden">Know what a turtle is?</p>
<p class="holden">Same thing.</p>
<p class="holden">You reach down and flip the tortoise over on its back, Leon.</p>
<p class="holden">The tortoise lays on its back, its belly baking in the hot sun, beating its legs trying to turn itself over. But it can't. Not with out your help. But you're not helping.</p>
<p class="holden">I mean you're not helping! Why is that, Leon?</p>
<p class="holden">They're just questions, Leon. In answer to your query, they're written down for me. It's a test designed to provoke an emotional response.</p>
<p class="holden">Shall we continue?</p>
<p class="holden">Describe in single words. Only the good things that come to your mind. About your mother.</p>
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/881020/br6.jpg">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/881020/br3.jpg">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/881020/br1.jpg">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/881020/br6a.jpg">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/881020/br2.jpg">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/881020/br3a.jpg">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/881020/br7a.jpg">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/881020/br1a.jpg">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/881020/br5a.jpg">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/881020/br7.jpg">
</div>
body{
font-family: 'Saira Extra Condensed', sans-serif;
color: white;
background-color: #070514;
font-weight: 200;
}
#holder {
display:grid;
width: 100%;
height: 420vw;
overflow: hidden;
grid-template-columns: repeat(auto-fill, 5vw);
grid-auto-rows: 2.88675vw;
}
#holder > *{
transform-origin: top left;
background-color: #021226;
line-height: 120%;
}
h1 {
transform: skewY(-30deg);
font-size: 4vw;
padding: 1.2vw;
border-left: white 1px solid;
z-index: 10;
}
img{
height:100%;
transform: rotatez(-60deg) skewY(30deg);
z-index: 5;
}
p {
font-size: 2.4vw;
padding: 1.5vw 1vw 1vw 1vw;
margin-bottom: 1px;
}
.leon {
border-bottom: #13ebe3 1px solid;
color: #13ebe3;
text-align: right;
transform: skewY(30deg);
z-index: 10;
}
.holden {
border-top: #de7eb5 1px solid;
color: #de7eb5;
transform: skewY(-30deg);
z-index: 15;
}
#holder > p{
grid-column-end: span 3;
grid-row-end: span 2;
}
#holder > *:nth-child(1){
grid-column-start: 2;
grid-row-start: 4;
grid-column-end: span 5;
grid-row-end: span 6;
}
#holder > *:nth-child(2){
grid-column-start: 10;
grid-row-start: 4;
}
#holder > *:nth-child(3){
grid-column-start: 12;
grid-row-start: 8;
grid-row-end: span 4;
}
#holder > *:nth-child(4){
grid-column-start: 18;
grid-row-start: 14;
grid-column-end: span 2;
}
#holder > *:nth-child(5){
grid-column-start: 8;
grid-row-start: 14;
grid-column-end: span 4;
grid-row-end: span 4;
}
#holder > *:nth-child(6){
grid-column-start: 17;
grid-row-start: 23;
grid-column-end: span 2;
}
#holder > *:nth-child(7){
grid-column-start: 5;
grid-row-start: 25;
grid-column-end: span 4;
}
#holder > *:nth-child(8){
grid-column-start: 7;
grid-row-start: 31;
}
#holder > *:nth-child(9){
grid-column-start: 12;
grid-row-start: 36;
grid-column-end: span 4;
grid-row-end: span 4;
}
#holder > *:nth-child(10){
grid-column-start: 16;
grid-row-start: 46;
grid-column-end: span 5;
}
#holder > *:nth-child(11){
grid-column-start: 6;
grid-row-start: 44;
grid-column-end: span 2;
grid-row-end: span 4;
}
#holder > *:nth-child(12){
grid-column-start: 7;
grid-row-start: 55;
grid-column-end: span 2;
}
#holder > *:nth-child(13){
grid-column-start: 10;
grid-row-start: 58;
grid-column-end: span 2;
grid-row-end: span 4;
}
#holder > *:nth-child(14){
grid-column-start: 16;
grid-row-start: 60;
grid-row-end: span 4;
}
#holder > *:nth-child(15){
grid-column-start: 2;
grid-row-start: 76;
grid-column-end: span 2;
grid-row-end: span 4;
}
#holder > *:nth-child(16){
grid-column-start: 5;
grid-row-start: 81;
grid-column-end: span 2;
}
#holder > *:nth-child(17){
grid-column-start: 8;
grid-row-start: 86;
grid-column-end: span 4;
}
#holder > *:nth-child(18){
grid-column-start: 9;
grid-row-start: 89;
grid-column-end: span 4;
grid-row-end: span 4;
}
#holder > *:nth-child(19){
grid-column-start: 3;
grid-row-start: 95;
grid-column-end: span 7;
grid-row-end: span 4;
}
#holder > *:nth-child(20){
grid-column-start: 3;
grid-row-start: 107;
grid-row-end: span 4;
}
#holder > *:nth-child(21){
grid-column-start: 13;
grid-row-start: 125;
grid-column-end: span 6;
grid-row-end: span 8;
font-size: 5vw;
}
#holder > *:nth-child(22){
grid-column-start: 16;
grid-row-start: 14;
}
#holder > *:nth-child(23){
grid-column-start: 12;
grid-row-start: 22;
grid-column-end: span 6;
grid-row-end: span 4;
}
#holder > *:nth-child(24){
grid-column-start: 0;
grid-row-start: 27;
grid-column-end: span 4;
grid-row-end: span 4;
}
#holder > *:nth-child(25){
grid-column-start: 9;
grid-row-start: 31;
grid-column-end: span 2;
}
#holder > *:nth-child(26){
grid-column-start: 10;
grid-row-start: 36;
}
#holder > *:nth-child(27){
grid-column-start: 13;
grid-row-start: 45;
grid-row-end: span 4;
}
#holder > *:nth-child(28){
grid-column-start: 2;
grid-row-start: 48;
grid-column-end: span 4;
grid-row-end: span 4;
}
#holder > *:nth-child(29){
grid-column-start: 5;
grid-row-start: 53;
grid-column-end: span 6;
grid-row-end: span 4;
}
#holder > *:nth-child(30){
grid-column-start: 9;
grid-row-start: 57;
grid-column-end: span 2;
}
#holder > *:nth-child(31){
grid-column-start: 11;
grid-row-start: 63;
grid-column-end: span 5;
grid-row-end: span 4;
}
#holder > *:nth-child(32){
grid-column-start: 13;
grid-row-start: 71;
grid-column-end: span 8;
grid-row-end: span 4;
}
#holder > *:nth-child(33){
grid-column-start: 2;
grid-row-start: 84;
grid-row-end: span 4;
}
#holder > *:nth-child(34){
grid-column-start: 6;
grid-row-start: 86;
}
#holder > *:nth-child(35){
grid-column-start: 14;
grid-row-start: 94;
grid-column-end: span 6;
grid-row-end: span 4;
}
#holder > *:nth-child(36){
grid-column-start: 11;
grid-row-start: 105;
grid-column-end: span 9;
grid-row-end: span 4;
}
#holder > *:nth-child(37){
grid-column-start: 5;
grid-row-start: 117;
grid-column-end: span 4;
grid-row-end: span 4;
}
#holder > *:nth-child(38){
grid-column-start: 8;
grid-row-start: 118;
grid-column-end: span 8;
grid-row-end: span 4;
}
#holder > *:nth-child(39){
grid-column-start: 13;
grid-row-start: 119;
grid-column-end: span 4;
}
#holder > *:nth-child(40){
grid-column-start: 3;
grid-row-start: 129;
grid-column-end: span 6;
grid-row-end: span 4;
}
#holder > *:nth-child(41){
grid-column-start: 11;
grid-row-start: 5;
grid-row-end: span 10;
}
#holder > *:nth-child(42){
grid-column-start: 1;
grid-row-start: 13;
grid-row-end: span 12;
margin-left: -20vw;
}
#holder > *:nth-child(43){
grid-column-start: 12;
grid-row-start: 32;
grid-row-end: span 12;
}
#holder > *:nth-child(44){
grid-column-start: 1;
grid-row-start: 37;
grid-row-end: span 10;
margin-left: -10vw;
}
#holder > *:nth-child(45){
grid-column-start: 8;
grid-row-start: 56;
grid-row-end: span 10;
}
#holder > *:nth-child(46){
grid-column-start: 1;
grid-row-start: 71;
grid-row-end: span 10;
margin-left: -10vw;
}
#holder > *:nth-child(47){
grid-column-start: 7;
grid-row-start: 83;
grid-row-end: span 10;
}
#holder > *:nth-child(48){
grid-column-start: 13;
grid-row-start: 107;
grid-row-end: span 8;
}
#holder > *:nth-child(49){
grid-column-start: 1;
grid-row-start: 105;
grid-row-end: span 8;
margin-left: -10vw;
}
#holder > *:nth-child(50){
grid-column-start: 1;
grid-row-start: 140;
grid-row-end: span 18;
margin-left: -5vw;
}
Also see: Tab Triggers