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.
<!-- this is a blockquote, used as it is intended for once -->
<blockquote class="pull">
<!-- and below, you will place your quote -->
My own sex, I hope, will excuse me, if I treat them like rational creatures, instead of flattering their fascinating graces, and viewing them as if they were in a state of perpetual childhood, unable to stand alone.
<!-- the following tag denotes the source of the quote in smaller text. you can actually make the text larger or smaller in the css, but it's necessary to leave the <small> tag in place for formatting reasons, dears -->
<small>Mary Wollstonecraft. <a href="https://sacred-texts.com/wmn/vind.txt">Vindication of the Rights of Woman. 1792.</a></small>
</blockquote><!-- Below, my dears, we have some filler text taken from Mary Wollstonecraft's *Vindication of the Rights of Woman* as proof of concept, to show how the normal text will wrap around the pull quote, which is also taken from this text -->
<p>I wish also to steer clear of an error which many respectable writers have fallen into; for the instruction which has hitherto been addressed to women, has rather been applicable to ladies, if the little indirect advice, that is scattered through Sandford and Merton, be excepted; but, addressing my sex in a firmer tone, I pay particular attention to those in the middle class, because they appear to be in the most natural state. Perhaps the seeds of false-refinement, immorality, and vanity, have ever been shed by the great. Weak, artificial beings, raised above the common wants and affections of their race, in a premature unnatural manner, undermine the very foundation of virtue, and spread corruption through the whole mass of society! As a class of mankind they have the strongest claim to pity; the education of the rich tends to render them vain and helpless, and the unfolding mind is not strengthened by the practice of those duties which dignify the human character.- They only live to amuse themselves, and by the same law which in nature invariably produces certain effects, they soon only afford barren amusement.</p>
<p>But as I purpose taking a separate view of the different ranks of society, and of the moral character of women, in each, this hint is, for the present, sufficient; and I have only alluded to the subject, because it appears to me to be the very essence of an introduction to give a cursory account of the contents of the work it introduces.</p>
<p>My own sex, I hope, will excuse me, if I treat them like rational creatures, instead of flattering their fascinating graces, and viewing them as if they were in a state of perpetual childhood, unable to stand alone. I earnestly wish to point out in what true dignity and human happiness consists- I wish to persuade women to endeavour to acquire strength, both of mind and body, and to convince them that the soft phrases, susceptibility of heart, delicacy of sentiment, and refinement of taste, are almost synonymous with epithets of weakness, and that those beings who are only the objects of pity and that kind of love, which has been termed its sister, will soon become objects of contempt.</p>
<p>Dismissing then those pretty feminine phrases, which the men condescendingly use to soften our slavish dependence, and despising that weak elegancy of mind, exquisite sensibility, and sweet docility of manners, supposed to be the sexual characteristics of the weaker vessel, I wish to shew that elegance is inferior to virtue, that the first object of laudable ambition is to obtain a character as a human being, regardless of the distinction of sex; and that secondary views should be brought to this simple touchstone.</p>
<p>This is a rough sketch of my plan; and should I express my conviction with the energetic emotions that I feel whenever I think of the subject, the dictates of experience and reflection will be felt by some of my readers. Animated by this important object, I shall disdain to cull my phrases or polish my style;- I aim at being useful, and sincerity will render me unaffected; for, wishing rather to persuade by the force of my arguments, than dazzle by the elegance of my language, I shall not waste my time in rounding periods, or in fabricating the turgid bombast of artificial feelings, which, coming from the head, never reach the heart.- I shall be employed about things, not words!- and, anxious to render my sex more respectable members of society, I shall try to avoid that flowery diction which has slided from essays into novels, and from novels into familiar letters and conversation.</p>
/* simple body formatting, meant to be replaced by your own when you use this code */
body {
font-family: garamond;
background-color: #f0e8bb;
color: #7f6439;
font-size: 1.2em;
text-align: justify;
margin: 2em;
}
/* heart of the matter - styling the blockquote itself. the below affects the appearance of everything within the box containing the quote */
blockquote.pull {
background-color: #e1d2a6;
padding: 2em 2em 2em 2em;
padding-top: 2.2em;
text-align: justify;
font-size: 1.2em;
border: 4px solid #c2a77c;
margin: 0em 0.8em 0.8em 0em; /* because i'm floating the quote to the left, i've added a margin to every side except that one */
width: 20%;
border-radius: 1em;
color: #876c41;
position: relative;
float: left; /* this can be changed, but be sure to change the corresponding margins above such that there's no margin on the right (and a 0.8em margin on the left) if you do that */
}
/* the below two items just style how links appear within your blockquote, including within the source/citation. useful if you're linking to another page, as i've done here, as you can see */
blockquote.pull a {
text-decoration: none;
border-bottom: 1px solid #c2a77c;
color: #876c41;
border-radius: 3px;
transition: ease 1s all;
}
blockquote.pull a:hover {
border: 0px;
background-color: #c2a77c;
}
/* this section concerns the quotation marks resting in the corners of the quote container. trebuchet ms works well for them, but of course, they can be any color you want. the size can change, but that requires so much fiddling with margins that it frankly doesn't seem worth it... */
blockquote.pull::before,
blockquote.pull::after {
font-family: trebuchet ms;
font-size: 4em;
color: #c2a77c;
position: absolute;
}
blockquote.pull::before {
content: "“";
top: -0.1em;
left: 0em;
}
blockquote.pull::after {
content: "”";
bottom: -0.6em;
right: 0.1em;
}
/* i am here using the <small> tag within the <blockquote> tag as a signifier for the citation or source of the pullquote, whatever you want to call it. this styles that. */
blockquote.pull small {
text-align: right;
font-size: 0.7em;
display: block; /* important */
font-style: italic;
font-weight: bold;
margin: 0.5em 0em 0em 0em;
color: #876c41;
}
/* this adds a dash before the source of the quote, preventing you from having to do so manually with each quote */
blockquote.pull small::before {
content: "- ";
}
Also see: Tab Triggers