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>
<h1>Tables and Figures</h1>
<figure>
<img src="http://media.cinemasquid.com/blu-ray/titles/army-of-darkness/6903/screenshot-lrg-01.png" alt="">
<figcaption>
Alright you Primitive Screwheads, listen up! You see this? This... is my boomstick! The twelve-gauge double-barreled Remington. S-Mart's top of the line. You can find this in the sporting goods department. That's right, this sweet baby was made in Grand Rapids, Michigan. Retails for about a hundred and nine, ninety five. It's got a walnut stock, cobalt blue steel, and a hair trigger. That's right. Shop smart. Shop S-Mart. You got that?
</figcaption>
</figure>
<p>
Cupcake ipsum dolor. Sit amet jelly-o cake cookie donut muffin bear claw. Cookie tiramisu jelly icing cheesecake jujubes. Jelly beans icing pastry chocolate. Pudding sesame snaps chupa chups liquorice marzipan gummies. Cupcake applicake toffee.
</p>
<h2>Figures</h2>
<figure class="right">
<img src="https://1.bp.blogspot.com/-RxjT89UHsC4/VKW6sWE2UwI/AAAAAAAAGdw/5zeS_fc1RW0/s1600/RingWarmer_150px_128c.gif" alt="Animation showing the Ring Warmer in action."><figcaption>
Animation showing the Ring Warmer in action.
</figcaption>
</figure>
<p>
Chocolate bar gingerbread macaroon lollipop pie icing. Dragée jelly-o jujubes cheesecake cake pie topping sweet roll. Candy canes pudding candy chocolate bar bonbon. Jelly-o dragée brownie pastry candy canes marzipan powder. Fruitcake sesame snaps liquorice oat cake danish chocolate sweet roll. Donut cheesecake cookie chocolate cake topping. Bear claw toffee halvah apple pie chocolate bar danish muffin. Unerdwear.com soufflé bonbon macaroon pie.
</p>
<p>
Gummies croissant cookie jujubes. Bonbon pudding cookie. Dragée bear claw cheesecake. Bear claw chocolate chocolate cake applicake tootsie roll. Gummi bears cupcake tart halvah tootsie roll. Topping soufflé sesame snaps pastry gummi bears pie. Gummies pastry danish lollipop. Tart chupa chups dessert.
</p>
<p>
Liquorice powder icing. Cheesecake sweet cheesecake powder jelly gummi bears. Tootsie roll apple pie pie apple pie liquorice. Jelly wafer sugar plum. Bonbon sesame snaps donut. Macaroon lemon drops apple pie fruitcake cupcake gummies biscuit chupa chups croissant. Tootsie roll chocolate cake cheesecake jujubes gummies chocolate bar caramels. Chocolate cake brownie sesame snaps pudding ice cream cookie icing candy halvah.
</p>
<figure class="left">
<img src="https://4.bp.blogspot.com/-3cC0THj-mIY/VI5TOtr9HAI/AAAAAAAAGc8/Ej467d2kueA/s1600/Netscape1-about.gif" alt="Screen shot of the Netscape 1.0N browser information page." style="max-width:100%;height:auto;">
<figcaption>
Screen shot of the Netscape 1.0N browser information page.
</figcaption>
</figure>
<p>
Chocolate bar gingerbread macaroon lollipop pie icing. Dragée jelly-o jujubes cheesecake cake pie topping sweet roll. Candy canes pudding candy chocolate bar bonbon. Jelly-o dragée brownie pastry candy canes marzipan powder. Fruitcake sesame snaps liquorice oat cake danish chocolate sweet roll. Donut cheesecake cookie chocolate cake topping. Bear claw toffee halvah apple pie chocolate bar danish muffin. Unerdwear.com soufflé bonbon macaroon pie.
</p>
<p>
Gummies croissant cookie jujubes. Bonbon pudding cookie. Dragée bear claw cheesecake. Bear claw chocolate chocolate cake applicake tootsie roll. Gummi bears cupcake tart halvah tootsie roll. Topping soufflé sesame snaps pastry gummi bears pie. Gummies pastry danish lollipop. Tart chupa chups dessert.
</p>
<p>
Cupcake ipsum dolor. Sit amet jelly-o cake cookie donut muffin bear claw. Cookie tiramisu jelly icing cheesecake jujubes. Jelly beans icing pastry chocolate. Pudding sesame snaps chupa chups liquorice marzipan gummies. Cupcake applicake toffee.
</p>
<p>
Cupcake ipsum dolor. Sit amet jelly-o cake cookie donut muffin bear claw. Cookie tiramisu jelly icing cheesecake jujubes. Jelly beans icing pastry chocolate. Pudding sesame snaps chupa chups liquorice marzipan gummies. Cupcake applicake toffee.
</p>
<p>
Chocolate bar gingerbread macaroon lollipop pie icing. Dragée jelly-o jujubes cheesecake cake pie topping sweet roll. Candy canes pudding candy chocolate bar bonbon. Jelly-o dragée brownie pastry candy canes marzipan powder. Fruitcake sesame snaps liquorice oat cake danish chocolate sweet roll. Donut cheesecake cookie chocolate cake topping. Bear claw toffee halvah apple pie chocolate bar danish muffin. Unerdwear.com soufflé bonbon macaroon pie.
</p>
<h2>Tables and Tables in Figures</h2>
<table>
<colgroup>
<col>
<col>
<col class="number">
</colgroup>
<thead>
<tr>
<th>Author</th>
<th>Title</th>
<th class="number">Year Published</th>
</tr>
</thead>
<tbody>
<tr>
<td>Homer</td>
<td><em>Iliad</em></td>
<td class="number">BC ~800</td>
</tr>
<tr>
<td>Miguel De Cervantes</td>
<td><em>The Ingenious Gentleman Don Quixote of La Mancha</em></td>
<td class="number">AD 1605</td>
</tr>
<tr>
<td>Mary Shelley</td>
<td><em>Frankenstein; or, The Modern Prometheus</em></td>
<td class="number">1818</td>
</tr>
<tr>
<td>Herman Melville</td>
<td><em>Moby-Dick; or, The Whale</em></td>
<td class="number">1851</td>
</tr>
<tr>
<td>F. Scott Fitzgerald</td>
<td><em>The Great Gatsby</em></td>
<td class="number">1925</td>
</tr>
<tr>
<td>George Orwell</td>
<td><em>Nineteen Eighty-Four</em></td>
<td class="number">1948</td>
</tr>
</tbody>
</table>
<p>
Soufflé soufflé bear claw sweet cookie topping gummies. Marshmallow chupa chups cake sweet applicake chupa chups candy canes cake halvah. Toffee jelly-o toffee halvah candy canes gummi bears. Jelly-o donut danish oat cake fruitcake chupa chups. Dragée apple pie dragée fruitcake jelly macaroon pastry muffin. Gummi bears chocolate macaroon pastry. Jujubes lollipop chupa chups carrot cake pastry chocolate cake toffee.
</p>
<figure>
<table>
<colgroup>
<col>
<col>
<col class="number">
</colgroup>
<thead>
<tr>
<th>Author</th>
<th>Title</th>
<th class="number">Year Published</th>
</tr>
</thead>
<tbody>
<tr>
<td>Homer</td>
<td><em>Iliad</em></td>
<td class="number">BC ~800</td>
</tr>
<tr>
<td>Miguel De Cervantes</td>
<td><em>The Ingenious Gentleman Don Quixote of La Mancha</em></td>
<td class="number">AD 1605</td>
</tr>
<tr>
<td>Mary Shelley</td>
<td><em>Frankenstein; or, The Modern Prometheus</em></td>
<td class="number">1818</td>
</tr>
<tr>
<td>Herman Melville</td>
<td><em>Moby-Dick; or, The Whale</em></td>
<td class="number">1851</td>
</tr>
<tr>
<td>F. Scott Fitzgerald</td>
<td><em>The Great Gatsby</em></td>
<td class="number">1925</td>
</tr>
<tr>
<td>George Orwell</td>
<td><em>Nineteen Eighty-Four</em></td>
<td class="number">1948</td>
</tr>
</tbody>
</table>
<figcaption>
This is a list of books that I probably should have read, some of which I have read, but not all of which have I read.
</figcaption>
</figure>
<p>
Liquorice powder icing. Cheesecake sweet cheesecake powder jelly gummi bears. Tootsie roll apple pie pie apple pie liquorice. Jelly wafer sugar plum. Bonbon sesame snaps donut. Macaroon lemon drops apple pie fruitcake cupcake gummies biscuit chupa chups croissant. Tootsie roll chocolate cake cheesecake jujubes gummies chocolate bar caramels. Chocolate cake brownie sesame snaps pudding ice cream cookie icing candy halvah.
</p>
<figure class="left">
<table>
<colgroup>
<col>
<col>
<col class="number">
</colgroup>
<thead>
<tr>
<th>Author</th>
<th>Title</th>
<th class="number">Year Published</th>
</tr>
</thead>
<tbody>
<tr>
<td>Homer</td>
<td><em>Iliad</em></td>
<td class="number">BC ~800</td>
</tr>
<tr>
<td>Miguel De Cervantes</td>
<td><em>The Ingenious Gentleman Don Quixote of La Mancha</em></td>
<td class="number">AD 1605</td>
</tr>
<tr>
<td>Mary Shelley</td>
<td><em>Frankenstein; or, The Modern Prometheus</em></td>
<td class="number">1818</td>
</tr>
<tr>
<td>Herman Melville</td>
<td><em>Moby-Dick; or, The Whale</em></td>
<td class="number">1851</td>
</tr>
<tr>
<td>F. Scott Fitzgerald</td>
<td><em>The Great Gatsby</em></td>
<td class="number">1925</td>
</tr>
<tr>
<td>George Orwell</td>
<td><em>Nineteen Eighty-Four</em></td>
<td class="number">1948</td>
</tr>
</tbody>
</table>
<figcaption>
This is a list of books that I probably should have read, some of which I have read, but not all of which have I read.
</figcaption>
</figure>
<p>
Chocolate bar gingerbread macaroon lollipop pie icing. Dragée jelly-o jujubes cheesecake cake pie topping sweet roll. Candy canes pudding candy chocolate bar bonbon. Jelly-o dragée brownie pastry candy canes marzipan powder. Fruitcake sesame snaps liquorice oat cake danish chocolate sweet roll. Donut cheesecake cookie chocolate cake topping. Bear claw toffee halvah apple pie chocolate bar danish muffin. Unerdwear.com soufflé bonbon macaroon pie.
</p>
<p>
Gummies croissant cookie jujubes. Bonbon pudding cookie. Dragée bear claw cheesecake. Bear claw chocolate chocolate cake applicake tootsie roll. Gummi bears cupcake tart halvah tootsie roll. Topping soufflé sesame snaps pastry gummi bears pie. Gummies pastry danish lollipop. Tart chupa chups dessert.
</p>
<p>
Cupcake ipsum dolor. Sit amet jelly-o cake cookie donut muffin bear claw. Cookie tiramisu jelly icing cheesecake jujubes. Jelly beans icing pastry chocolate. Pudding sesame snaps chupa chups liquorice marzipan gummies. Cupcake applicake toffee.
</p>
<p>
Cupcake ipsum dolor. Sit amet jelly-o cake cookie donut muffin bear claw. Cookie tiramisu jelly icing cheesecake jujubes. Jelly beans icing pastry chocolate. Pudding sesame snaps chupa chups liquorice marzipan gummies. Cupcake applicake toffee.
</p>
<p>
Chocolate bar gingerbread macaroon lollipop pie icing. Dragée jelly-o jujubes cheesecake cake pie topping sweet roll. Candy canes pudding candy chocolate bar bonbon. Jelly-o dragée brownie pastry candy canes marzipan powder. Fruitcake sesame snaps liquorice oat cake danish chocolate sweet roll. Donut cheesecake cookie chocolate cake topping. Bear claw toffee halvah apple pie chocolate bar danish muffin. Unerdwear.com soufflé bonbon macaroon pie.
</p>
<p>
Liquorice powder icing. Cheesecake sweet cheesecake powder jelly gummi bears. Tootsie roll apple pie pie apple pie liquorice. Jelly wafer sugar plum. Bonbon sesame snaps donut. Macaroon lemon drops apple pie fruitcake cupcake gummies biscuit chupa chups croissant. Tootsie roll chocolate cake cheesecake jujubes gummies chocolate bar caramels. Chocolate cake brownie sesame snaps pudding ice cream cookie icing candy halvah.
</p>
</main>
@import url(https://fonts.googleapis.com/css?family=Lato:400,700);
@import url(https://fonts.googleapis.com/css?family=Linden+Hill);
body {
background-color: #6D695C;
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAACVBMVEUAAAAAAAAAAACDY+nAAAAAA3RSTlMmDQBzGIDBAAAAG0lEQVR42uXIIQEAAADCMHj/0NdkQMws0HEeAqvwAUGJthrXAAAAAElFTkSuQmCC);
font-size: 100%;
color: #fff;
font-family: Lato, Arial, sans-serif;
padding: 0;
margin: 0;
line-height: 1.4;
}
main {
width: 80%;
margin: 1em auto;
padding: 1em 2em;
color: #000;
background-color: rgba(255,255,255,.25);
border: .07em solid rgba(0,0,0,.5);
border-radius: .5em;
}
main::after {
content: "";
display: block;
clear: both;
}
a {
color: #009;
}
h1, h2, h3 {
font-weight: normal;
font-family: 'Linden Hill', serif;
margin: .5em 0 0 0;
padding: 0;
font-size: 200%;
}
h2 {
font-size: 170%;
}
img {
max-width: 100%;
height: auto;
}
figure {
margin: 1em 0;
text-align: center;
overflow: auto;
}
figure.right, figure.left {
/*border: 1px dotted #f00;*/
border-top: .1em solid #000;
border-bottom: .1em solid #000;
padding: 1em 0;
width: 30%;
}
figure.right {
float: right;
margin-left: 2em;
}
figure.left {
float: left;
margin-right: 2em;
}
figcaption {
/*border: 1px solid #f00;*/
padding: .5em .5em 0 .5em;
font-style: italic;
font-family: 'Linden Hill', serif;
}
figure.right figcaption, figure.left figcaption {
padding-left: 0;
padding-right: 0;
}
table {
/*border: 1px dotted #00f;*/
margin: 1em 0;
border-collapse: collapse;
}
th, td {
padding: .25em .5em;
/*border: 1px dotted #0f0;*/
vertical-align: text-top;
text-align: left;
}
tr:nth-child(even) {
background-color: rgba(255,255,255,.25);
}
tr:nth-child(odd) {
background-color: rgba(0,0,0,.1);
}
th {
vertical-align: bottom;
background-color: rgba(0,0,0,.5);
color: #fff;
font-weight: bold;
}
td.right, th.right, td.number, th.number/*, col.number || td, col.right || td CSS4 table col selector */ {
text-align: right;
}
figure table {
width: 100%;
max-width: 100%;
}
@media (min-width:50em) {
body {
background-color: #5C6D69;
}
figure.right, figure.left {
padding: 1em .5em;
}
figcaption {
padding-left: 1em;
padding-right: 1em;
}
}
@media (min-width:70em) {
body {
background-color: #695C6D;
}
figure.right, figure.left {
padding: 1em;
}
figcaption {
padding-left: 2em;
padding-right: 2em;
}
}
Also see: Tab Triggers