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>
<p>Full disclosure: this page is an excerpt from an article on <a href="https://ilovetypography.com/2019/06/16/machiavelli-typographic-prince">ilovetypography.com</a>, including all content, images, attributions etc. I'm using it as a test scenario for practicing CSS, as the original was created using a clever combination of floats but is an ideal candidate for CSS Grid; if you are interested in the content or any other element then please <a href="https://ilovetypography.com/2019/06/16/machiavelli-typographic-prince">view the original article</a> (it's a lot more interesting).</p>
</header>
<article>
<p>The ‘exclusive’ papal protection granted to Blado was shortly thereafter extended to the famed Florentine family of printers, <a href="http://www.copyrighthistory.org/cam/tools/request/showRepresentation?id=representation_i_1531a">the Giunti</a>.§ The original handwritten papal privilege granted to the Giunti firm survives in the formerly ‘secret’ Vatican archives. The privilege states that as Blado had already sold most of his copies of Machiavelli’s books (i.e., his <a href="https://en.wikipedia.org/wiki/Discourses_on_Livy">Discourses on Livy</a>), and that the Giunti family also had the backing of Machiavelli’s heirs, then it was deemed only fair to extend printing rights to the Giunti. It is also worth mentioning that seldom were such privileges awarded freely out of apostolic benevolence. They were often very expensive but would be seen as investments by those who sought them — and the Giunti family were among the richest printers in Italy.</p>
<img class="grid-mid" src="https://ilt-typography.netdna-ssl.com/img/2019/06/prince-machiavelli-second-ed-giunti-rome-1523.jpg">
<aside class="grid-right">
<p>Actual page from the papal <em>privilege</em> granted in 1531 to the Giunti:</p>
<img src="https://ilt-typography.netdna-ssl.com/img/2019/06/giunti-papal-priv-1531.jpg">
<p class="grid-right">Source: <a href="http://www.copyrighthistory.org/cam/tools/request/showRepresentation.php?id=representation_i_1531a&pagenumber=1_1&imagesize=small">Primary Sources on Copyright (1450-1900)</a>.</p>
<p>Giunti’s title page for the second edition of <em>The Prince</em>. <a href="https://www.ustc.ac.uk/editions/839314">Eight copies</a> have survived. Photo courtesy of <a href="https://gallica.bnf.fr/ark:/12148/bpt6k852526w/f1.item">The National Library of France</a>.</p>
</aside>
<p>With the papal <em>privilege</em> in hand, the next and second edition of <em>The Prince</em> was published by the firm of Bernardo Giunti in Florence in May of the same year, 1523.</p>
<p>The above title-page for Bernardo Giunti’s Florentine edition of Machiavelli’s <em>The Prince</em>, bears the familiar Giunti fleur-de-lys supported by two cherubs, with the motto ‘Nil candidus’ (‘nothing fairer’) on the plinth. This edition, like the earlier Roman edition by Blado was published in one volume along with several other short pieces (The Prince is a relatively short work), including the biographical sketch, <em>The Life of Castruccio Castracani</em>.</p>
<blockquote>
<p>“The first method for estimating the intelligence of a ruler is to look at the men he has around him.”</p>
<footer>
― <cite>The Prince</cite>, chapter 22
</footer>
</blockquote>
<p>The Giunti were shrewd and especially quick to pick up on new and potentially profitable trends. Bernardo’s father Filippo (1450–1517) had been quick to imitate or plagiarize the new small-format, italic-type Aldine editions for which Aldus appears to have successfully <a href="http://www.copyrighthistory.org/cam/tools/request/showRecord?id=commentary_i_1503">sued</a> Filippo Giunti. And although the out and out forgeries ceased, Filippo continued to use italic typefaces. Perhaps the most notable feature of the Giunti italic used for typesetting the Florentine edition of <em>The Prince</em> is its oversized ampersand. Note too that the italic lowercase is paired with upright capitals, as were almost all italics until the late 1530s. (see <a href="https://amzn.to/2XElWn9"><em>Typographic Firsts</em></a>, p. 52).</p>
<p>The Giunti were shrewd and especially quick to pick up on new and potentially profitable trends. Bernardo’s father Filippo (1450–1517) had been quick to imitate or plagiarize the new small-format, italic-type Aldine editions for which Aldus appears to have successfully <a href="http://www.copyrighthistory.org/cam/tools/request/showRecord?id=commentary_i_1503">sued</a> Filippo Giunti. And although the out and out forgeries ceased, Filippo continued to use italic typefaces. Perhaps the most notable feature of the Giunti italic used for typesetting the Florentine edition of <em>The Prince</em> is its oversized ampersand. Note too that the italic lowercase is paired with upright capitals, as were almost all italics until the late 1530s. (see <a href="https://amzn.to/2XElWn9"><em>Typographic Firsts</em></a>, p. 52).</p>
<aside class="grid-right-offset">
<img src="https://ilt-typography.netdna-ssl.com/img/2019/06/giunti-papal-priv-1531.jpg">
</aside>
<p>The Giunti were shrewd and especially quick to pick up on new and potentially profitable trends. Bernardo’s father Filippo (1450–1517) had been quick to imitate or plagiarize the new small-format, italic-type Aldine editions for which Aldus appears to have successfully <a href="http://www.copyrighthistory.org/cam/tools/request/showRecord?id=commentary_i_1503">sued</a> Filippo Giunti. And although the out and out forgeries ceased, Filippo continued to use italic typefaces. Perhaps the most notable feature of the Giunti italic used for typesetting the Florentine edition of <em>The Prince</em> is its oversized ampersand. Note too that the italic lowercase is paired with upright capitals, as were almost all italics until the late 1530s. (see <a href="https://amzn.to/2XElWn9"><em>Typographic Firsts</em></a>, p. 52).</p>
</article>
* {
box-sizing: border-box;
font-family: sans-serif;
line-height: 1.4rem;
}
:root {
/* Columns */
--left: ;
--mid: 28rem;
--right: ;
--full-width: calc(3 * var(--mid) + 4rem);
}
body, html {
margin: 0;
padding: 0;
}
header {
width: 100%;
background-color: lightblue;
}
article {
display: grid;
grid-gap: 0 1rem;
width: 100%;
grid-template-columns: 10rem 18rem 28rem 18rem 10rem;
grid-template-rows: auto;
justify-content: center;
}
img {
max-width: 100%;
}
article > p, .grid-mid {
grid-column: 3;
}
.grid-right {
grid-column: 4;
}
.grid-right-offset {
position: relative;
}
.grid-right-offset > * {
position: fixed;
}
p + p, p + aside {
margin-top: 0;
}
blockquote {
grid-column: 1 / -1;
max-width: var(--full-width);
margin: 0;
padding: 3rem;
background-color: #f1bd68;
color: #ffffff;
font-size: 2rem;
}
blockquote p, blockquote footer {
max-width: 40rem;
margin: 0 auto;
line-height: 3rem;
}
blockquote p {
font-style: italic;
}
blockquote footer {
margin-top: 1rem;
font-size: 0.75rem;
color: #e8dbaf;
}
Also see: Tab Triggers