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 Skypack, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ES6 import
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.
<div class="computer-wrapper" data-0="top: 50%" data-end="top: 75%">
<span class="computer">
<i></i>
</span>
</div>
<div class="logo" data-0="opacity: 1" data-100="opacity: 0">
<span class="w">W</span><span class="world">orld</span><span class="web">eb</span><span class="d">D</span><span class="domination">omination</span><span class="design">esign</span>
<div class="sub-title">Otherwise known as that guy who sits at his computer too much.</div>
</div>
<main>
<h1>Quid enim de amicitia statueris utilitatis causa expetenda vides.</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Illis videtur, qui illud non dubitant bonum dicere -; Non laboro, inquit, de nomine. Qui autem esse poteris, nisi te amor ipse ceperit? </p>
<p>Ipse Epicurus fortasse redderet, ut Sextus Peducaeus, Sex. Nam et complectitur verbis, quod vult, et dicit plane, quod intellegam; Ita multa dicunt, quae vix intellegam. Quae cum magnifice primo dici viderentur, considerata minus probabantur. Quid est igitur, inquit, quod requiras? Hoc loco discipulos quaerere videtur, ut, qui asoti esse velint, philosophi ante fiant. Ac tamen hic mallet non dolere. Ita multo sanguine profuso in laetitia et in victoria est mortuus. Sed erat aequius Triarium aliquid de dissensione nostra iudicare. An tu me de L. </p>
<p>Non quaero, quid dicat, sed quid convenienter possit rationi et sententiae suae dicere. Idem iste, inquam, de voluptate quid sentit? Ita multo sanguine profuso in laetitia et in victoria est mortuus. Quid enim? Quae in controversiam veniunt, de iis, si placet, disseramus. Hanc quoque iucunditatem, si vis, transfer in animum; Nam ista vestra: Si gravis, brevis; </p>
<h2>Duo Reges: constructio interrete.</h2>
<p>At ille pellit, qui permulcet sensum voluptate. Illud non continuo, ut aeque incontentae. Nam illud vehementer repugnat, eundem beatum esse et multis malis oppressum. Bonum valitudo: miser morbus. Ergo in gubernando nihil, in officio plurimum interest, quo in genere peccetur. Quia, si mala sunt, is, qui erit in iis, beatus non erit. Ita relinquet duas, de quibus etiam atque etiam consideret. Quid, quod res alia tota est? Cur tantas regiones barbarorum pedibus obiit, tot maria transmisit? Sint modo partes vitae beatae. Quod non faceret, si in voluptate summum bonum poneret. Quod autem principium officii quaerunt, melius quam Pyrrho; </p>
<p>Idem iste, inquam, de voluptate quid sentit? Sapientem locupletat ipsa natura, cuius divitias Epicurus parabiles esse docuit. Quid, quod res alia tota est? Itaque ad tempus ad Pisonem omnes. Quodsi vultum tibi, si incessum fingeres, quo gravior viderere, non esses tui similis; Hoc loco tenere se Triarius non potuit. </p>
<p>Ratio quidem vestra sic cogit. An nisi populari fama? Qua tu etiam inprudens utebare non numquam. Illa videamus, quae a te de amicitia dicta sunt. Piso igitur hoc modo, vir optimus tuique, ut scis, amantissimus. Ut optime, secundum naturam affectum esse possit. Legimus tamen Diogenem, Antipatrum, Mnesarchum, Panaetium, multos alios in primisque familiarem nostrum Posidonium. Quod totum contra est. </p>
<h4>Et harum quidem rerum facilis est et expedita distinctio.</h4>
<p>Quae fere omnia appellantur uno ingenii nomine, easque virtutes qui habent, ingeniosi vocantur. Maximas vero virtutes iacere omnis necesse est voluptate dominante. Sin laboramus, quis est, qui alienae modum statuat industriae? Hoc non est positum in nostra actione. Virtutis, magnitudinis animi, patientiae, fortitudinis fomentis dolor mitigari solet. </p>
<p>Non dolere, inquam, istud quam vim habeat postea videro; Hoc enim constituto in philosophia constituta sunt omnia. Mihi vero, inquit, placet agi subtilius et, ut ipse dixisti, pressius. Eadem nunc mea adversum te oratio est. Sed ne, dum huic obsequor, vobis molestus sim. Illud quaero, quid ei, qui in voluptate summum bonum ponat, consentaneum sit dicere. Minime vero istorum quidem, inquit. Atque ab isto capite fluere necesse est omnem rationem bonorum et malorum. Theophrasti igitur, inquit, tibi liber ille placet de beata vita? </p>
<h5>-, sed ut hoc iudicaremus, non esse in iis partem maximam positam beate aut secus vivendi.</h5>
<p>Rhetorice igitur, inquam, nos mavis quam dialectice disputare? Nunc haec primum fortasse audientis servire debemus. Universa enim illorum ratione cum tota vestra confligendum puto. Unum nescio, quo modo possit, si luxuriosus sit, finitas cupiditates habere. </p>
<h3>Virtutibus igitur rectissime mihi videris et ad consuetudinem nostrae orationis vitia posuisse contraria.</h3>
<p>Apud imperitos tum illa dicta sunt, aliquid etiam coronae datum; Expressa vero in iis aetatibus, quae iam confirmatae sunt. Traditur, inquit, ab Epicuro ratio neglegendi doloris. Certe, nisi voluptatem tanti aestimaretis. </p>
</main>
@import "compass/css3";
body {
background-color: #2c3e50;
background-image: url(https://lh5.googleusercontent.com/-HuFyNtcLT-I/Uy26BPDSOCI/AAAAAAAAA24/iimOGxodRFg/s485-no/circuit.png);
margin: 0;
padding: 0;
}
/* =============================================== /*
/* Animation /*
/* =============================================== */
/* Slide Code (Black Screen) */
@-webkit-keyframes slide {
from{
background-position:0px 0px;
}
to{
background-position:0px 239px;
}
}
@-moz-keyframes slide {
from{
background-position:0px 0px;
}
to{
background-position:0px 239px;
}
}
@-o-keyframes slide {
from{
background-position:0px 0px;
}
to{
background-position:0px 239px;
}
}
@keyframes slide {
from{
background-position:0px 0px;
}
to{
background-position:0px 239px;
}
}
.computer-wrapper {
position: fixed;
top: 50%;
left: 50%;
margin-left: -180px - 8px;
}
.computer {
box-shadow: 0 0 5px 5px #2c3e50;
position: absolute;
width: 360px;
height: 241px;
background: #343441;
border: 8px solid #525151;
top: -296px;
background:url(http://i39.tinypic.com/2w5oktu.jpg);
background-size: 100% 100%;
-webkit-animation: slide 15s linear infinite;
-moz-animation: slide 15s linear infinite;
-o-animation: slide 15s linear infinite;
animation: slide 15s linear infinite;
// stand top
&:before {
content: '';
position: absolute;
background: #343434;
width: 78px;
height: 17px;
bottom: -25px;
left: 51px + 90px;
}
// stand middle
&:after {
content: '';
position: absolute;
width: 76px;
height: 0;
bottom: -38px;
right: 38px + 90px;
border-bottom: 14px solid #626262;
border-left: 13px solid rgba(0, 0, 0, 0);
border-right: 14px solid rgba(0, 0, 0, 0);
}
// stand bottom
i {
position: absolute;
background: #343434;
width: 103px;
height: 9px;
bottom: -47px;
left: 39px + 90px;
}
}
.logo {
font-size: 300%;
position: fixed;
width: 14em;
font-family: 'Habibi', serif;
color: white;
bottom: 0.25em;
left: 0.25em;
.w, .d {
font-size: 400%;
}
.d {
padding-left: 0.25em;
}
.world, .domination {
position: absolute;
vertical-align: top;
margin-top: 1em;
display: inline-block;
}
.web, .design {
position: relative;
vertical-align: bottom;
margin-bottom: 1em;
display: inline-block;
}
.sub-title {
text-align: center;
font-family: 'Habibi', serif;
font-size: 50%;
}
}
main {
&, *, *:before, *:after {
-moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box;
}
position: absolute;
top: 100%;
left: 20%;
right: 20%;
padding: 1em;
-webkit-transition: 0.5s all;
-moz-transition: 0.5s all;
-o-transition: 0.5s all;
transition: 0.5s all;
@media all and (max-width: 70em) {
left: 5em;
right: 5em;
}
@media all and (max-width: 40em) {
left: 0;
right: 0;
}
background-color: white;
}
var s = skrollr.init();
Also see: Tab Triggers