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.
header
h1 Simple Slide-Out Footer
main
article
h1 Chapter 1
p Along this particular stretch of line no express had ever passed. All the trains—the few that there were—stopped at all the stations. Denis knew the names of those stations by heart. Bole, Tritton, Spavin Delawarr, Knipswich for Timpany, West Bowlby, and, finally, Camlet-on-the-Water. Camlet was where he always got out, leaving the train to creep indolently onward, goodness only knew whither, into the green heart of England.
p They were snorting out of West Bowlby now. It was the next station, thank Heaven. Denis took his chattels off the rack and piled them neatly in the corner opposite his own. A futile pro- ceeding. But one must have something to do. When he had fin- ished, he sank back into his seat and closed his eyes. It was ex- tremely hot.
p Oh, this journey! It was two hours cut clean out of his life; two hours in which he might have done so much, so much—written the perfect poem, for example, or read the one illuminating book. Instead of which—his gorge rose at the smell of the dusty cushions against which he was leaning.
p Two hours. One hundred and twenty minutes. Anything might be done in that time. Anything. Nothing. Oh, he had had hundreds of hours, and what had he done with them? Wasted them, spilt the precious minutes as though his reservoir were inexhaustible. Denis groaned in the spirit, condemned himself utterly with all his works. What right had he to sit in the sun- shine, to occupy corner seats in third-class carriages, to be alive? None, none, none.
p Misery and a nameless nostalgic distress possessed him. He was twenty-three, and oh! so agonizingly conscious of the fact.
p The train came bumpingly to a halt. Here was Camlet at last. Denis jumped up, crammed his hat over his eyes, deranged his pile of baggage, leaned out of the window and shouted for a porter, seized a bag in either hand, and had to put them down again in order to use the door. When at last he had safely bundled himself and his baggage on to the platform, he ran up the train towards the van.
p "A bicycle, a bicycle!" he said breathlessly to the guard. He felt himself a man of action. The guard paid no attention, but continued methodically to hand out, one by one, the packages labelled to Camlet. "A bicycle!" Denis repeated. "A green machine, cross-framed, name of Stone. S-T-O-N-E."
p "All in good time, sir," said the guard soothingly. He was a large, stately man with a naval beard. One pictured him at home, drinking tea, surrounded by a numerous family. It was in that tone that he must have spoken to his children when they were tiresome. "All in good time, sir." Denis's man of action collapsed, punctured.
p He left his luggage to be called for later, and pushed off on his bicycle. He always took his bicycle when he went into the country. It was part of the theory of exercise. One day one would get up at six o'clock and pedal away to Kenilworth, or Stratford-on-Avon—anywhere. And within a radius of twenty miles there were always Norman churches and Tudor mansions to be seen in the course of an afternoon's excursion. Somehow they never did get seen, but all the same it was nice to feel that the bicycle was there, and that one fine morning one really might get up at six.
p Once at the top of the long hill which led up from Camlet sta- tion, he felt his spirits mounting. The world, he found, was good. The far-away blue hills, the harvests whitening on the slopes of the ridge along which his road led him, the treeless sky-lines that changed as he moved—yes, they were all good. He was overcome by the beauty of those deeply embayed combes, scooped in the flanks of the ridge beneath him. Curves, curves: he repeated the word slowly, trying as he did so to find some term in which to give expression to his appreci- ation. Curves—no, that was inadequate. He made a gesture with his hand, as though to scoop the achieved expression out of the air, and almost fell off his bicycle. What was the word to describe the curves of those little valleys? They were as fine as the lines of a human body, they were informed with the sub- tlety of art...
p Galbe. That was a good word; but it was French. Le galbe evase de ses hanches: had one ever read a French novel in which that phrase didn't occur? Some day he would compile a dictionary for the use of novelists. Galbe, gonfle, goulu: par- fum, peau, pervers, potele, pudeur: vertu, volupte.
p But he really must find that word. Curves curves... Those little valleys had the lines of a cup moulded round a woman's breast; they seemed the dinted imprints of some huge divine body that had rested on these hills. Cumbrous locutions, these; but through them he seemed to be getting nearer to what he wanted. Dinted, dimpled, wimpled—his mind wandered down echoing corridors of assonance and alliteration ever further and further from the point. He was enamoured with the beauty of words.
p Becoming once more aware of the outer world, he found him- self on the crest of a descent. The road plunged down, steep and straight, into a considerable valley. There, on the opposite slope, a little higher up the valley, stood Crome, his destina- tion. He put on his brakes; this view of Crome was pleasant to linger over. The facade with its three projecting towers rose precipitously from among the dark trees of the garden. The house basked in full sunlight; the old brick rosily glowed. How ripe and rich it was, how superbly mellow! And at the same time, how austere! The hill was becoming steeper and steeper; he was gaining speed in spite of his brakes. He loosed his grip of the levers, and in a moment was rushing headlong down. Five minutes later he was passing through the gate of the great courtyard. The front door stood hospitably ajar. He left his bicycle leaning against the wall and walked in. He would take them by surprise.
footer
a href="#chapter2" Continue to Chapter 2
@import compass
$footerheight: 180px
main
position: relative
z-index: 1
margin-bottom: $footerheight
footer
position: fixed
left: 0
right: 0
bottom: 0
height: $footerheight
// Anything below this point just makes it pretty
header
padding-left: 1em
font: bold 16px/48px sans-serif
color: #eee
background: #222
main
color: #222
background: #eee
article
width: 540px
margin: auto
padding: 60px 0 24px
h1, p
margin-bottom: 1.2em
h1
width: 100%
border-bottom: 1px solid #222
font: 30px serif
p
font: 24px/1.4em serif
footer
text-align: center
background: #222
a
border-bottom: 1px solid #666
color: #eee
font: 24px/#{$footerheight} serif
text-decoration: none
Also see: Tab Triggers