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.
<div class="page-wrap">
<article>
<header class="article-header">
<h4 class="classification-header">
Archaeostronomy
</h4>
<svg viewBox="0 0 560 259" class="header-lockup">
<text transform="matrix(1 0 0 1 -0.00007 116.14385)"><tspan x="0" y="0" font-family="'Montserrat'" font-size="157px">STARS</tspan><tspan x="0" y="139" font-family="'Montserrat'" font-size="181px">DEAD</tspan></text>
<circle fill="#FFFFFF" cx="128.50781" cy="126.5" r="34.5"/>
<text transform="matrix(1 0 0 1 114.62256 123)">
<tspan x="0" y="0" font-family="'Montserrat'" font-size="19px">OF</tspan><tspan x="-6.28906" y="17" font-family="'Montserrat'" font-size="19px">THE</tspan>
</text>
</svg>
<h2>
Mysterious tables of astrononmical information have been found in 4,000-year-old coffins. What in the world was their purpose?
</h2>
<div class="byline">
By Sarah Symons and Elizabeth Tasker
</div>
</header>
<div class="intro-ps">
<p><strong>Lorem ipsum dolor sit amet,</strong> consectetur adipisicing elit. Illum quaerat quod nemo voluptas voluptatum itaque eaque amet consequuntur cum quam error dolore facilis reprehenderit impedit, consectetur ex, quae, ducimus deserunt.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptatem, facilis eligendi. Saepe blanditiis animi commodi modi alias accusamus similique reprehenderit aliquam non dolores quos, nisi nam aliquid beatae adipisci cumque?</p>
<p>Voluptates placeat totam illo sapiente magni animi corrupti, aut iure mollitia nihil. Dolores magni quod praesentium laudantium, et aperiam voluptatem nobis, iste voluptates, sint excepturi tempore asperiores ex saepe cupiditate.</p>
</div>
<aside class="in-brief">
<h3>In Brief</h3>
<div class="in-brief-content">
<p><strong>Ancient Egyptians</strong> habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget. <strong>Long thought to serve in</strong> ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. <strong>Go to bed.</strong>all franco coo beansio. and stuff and stuff hello vegas.</p>
</div>
</aside>
<div class="article-body">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dignissimos ipsa ad rem, incidunt non unde iure deleniti, maiores, aperiam quidem ducimus voluptates, excepturi tenetur culpa laborum provident illum corporis suscipit.</p>
<p>Ad nihil dolorem perspiciatis dolores, fugit harum libero adipisci enim pariatur nobis repudiandae minima obcaecati molestias blanditiis? Optio doloremque, sit ipsa aperiam numquam ducimus quam, iure eum quae ad pariatur!</p>
<p>Adipisci magni dolore labore porro quia accusamus libero ratione ab atque consequuntur quisquam eius minima quos consequatur eligendi, recusandae quis qui harum ipsum possimus deleniti dolorum ut sint voluptate? Possimus.</p>
<h3>Star Clocks?</h3>
<p>Veniam voluptatibus velit accusantium iusto eum eos in totam itaque, minus eveniet asperiores, laborum dignissimos, officia quia quod amet debitis. Quisquam suscipit, vel sapiente? Quae cumque aspernatur labore placeat odio.</p>
<p>Hic accusamus porro iure aperiam facilis excepturi numquam unde molestiae fuga? Eveniet ipsum eos laboriosam, soluta, expedita accusamus officia atque voluptas inventore nesciunt eligendi perspiciatis distinctio quod, quia pariatur magnam.</p>
<p>Dicta quaerat vero, laudantium recusandae odit enim repudiandae expedita dolorum dolor id consequatur est quas vel, corrupti sit quae quis rem officiis, ad. Itaque fuga harum voluptatum enim architecto odit.</p>
<figure>
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/3/star-table.jpg" alt="" />
<figcaption>
STAR TABLE shown here is display at the cool museum on super street in city country and sometimes it has a coffin on it.
</figcaption>
</figure>
<p>Expedita beatae, a rem, excepturi repellendus dolorem dolore, aperiam magnam fugiat eos optio asperiores illo veniam voluptas architecto, dolores officia cupiditate. Quibusdam vel voluptate, atque quo eius qui officiis consequuntur.</p>
<p>Libero a eius nesciunt, molestiae, perspiciatis quaerat facilis consequuntur odio eligendi quas tenetur officiis suscipit, recusandae omnis laboriosam exercitationem unde ducimus totam quos corporis obcaecati ex, voluptatibus voluptatum aspernatur necessitatibus?</p>
<p>Iure accusamus quisquam aspernatur dicta iste, unde ullam hic nostrum est placeat consequuntur aut, molestias fuga praesentium voluptas sit ipsum voluptatum inventore voluptatem amet odio nesciunt. Cupiditate iure saepe ipsam.</p>
<p>Laudantium veritatis ratione iusto voluptatibus reiciendis sunt numquam non est nam inventore laboriosam id recusandae aliquid, vero, aspernatur amet cumque esse quisquam beatae consectetur totam doloribus iure maxime tempora! Tempore.</p>
<p>Dolore sapiente rem velit recusandae illo natus eum. Facilis natus enim delectus corrupti hic voluptatibus ipsa ut quibusdam ducimus magni velit eaque ad perspiciatis modi id, cumque odio repellat explicabo.</p>
<p>Doloremque assumenda expedita delectus nesciunt, numquam vero architecto esse eaque veritatis maiores error ipsa, quaerat iusto harum. Itaque, corporis. Excepturi optio accusantium totam ipsa id sequi ad, corrupti soluta quam?</p>
<p>Delectus, perferendis? Iusto ipsa vitae natus culpa accusamus, rerum nostrum excepturi aspernatur repellendus illo animi deleniti in, blanditiis eius, minima et quisquam harum dolorum asperiores tempore. Asperiores reiciendis quasi, praesentium!</p>
<p>Ullam repellat deleniti perferendis fugiat ratione commodi suscipit expedita pariatur quidem porro dolorem veniam, cumque quasi accusantium at mollitia culpa vitae natus facilis laborum placeat. Temporibus voluptates nihil error consequuntur?</p>
<p>Aliquid praesentium ratione impedit, quo error unde mollitia quos iste labore eligendi. Ipsum delectus voluptatem tempore veniam fuga doloribus, quae temporibus, eum laborum ex dolorem quasi quidem ad adipisci est!</p>
<p>Praesentium minima sit hic et dolorum ab cum reprehenderit nam, vero earum, debitis quod laborum ratione iusto voluptatibus dolor! A, natus. Cumque impedit sunt blanditiis non, dolorum possimus quas cum?</p>
<p>Dicta sunt consequuntur, velit aliquid cumque pariatur error sapiente odio ratione distinctio vero impedit, voluptates ab! Quam quod unde possimus debitis, nulla et, nemo tenetur dolor tempora consequuntur fuga! Commodi.</p>
<p>Vero minus vel consectetur, eos praesentium beatae atque voluptatum consequatur saepe quibusdam dolor error necessitatibus, non modi natus. Reprehenderit magnam harum inventore repellat velit, id architecto perferendis soluta delectus corporis!</p>
<p>Corporis deserunt enim perspiciatis quo ex minus. Eveniet labore voluptatum vel exercitationem. Expedita distinctio optio at vero cumque omnis dolores consequatur, enim eaque numquam dicta facilis laboriosam nemo odio nesciunt!</p>
<p>Explicabo similique quod provident nisi facere officiis, inventore ducimus eos culpa. Fugit ut nesciunt laudantium expedita laboriosam quod! Tenetur ratione sapiente reiciendis at, quo dignissimos. Corporis libero dolorem eligendi laborum.</p>
</div>
</article>
</div>
@import url(https://fonts.googleapis.com/css?family=Montserrat:700|Crimson+Text:400,400italic,700italic,700);
html {
font-family: 'Crimson Text', serif;
font-size: 18px;
line-height: 1.3;
@media (max-width: 520px) {
font-size: 16px;
}
}
.page-wrap {
max-width: 1000px;
margin: 20px auto;
padding: 20px;
}
.article-header {
text-align: center;
@media (max-width: 520px) {
h2 {
font-size: 1.2rem;
}
}
}
.classification-header {
text-transform: uppercase;
color: red;
letter-spacing: 0.1rem;
}
.intro-ps {
columns: 2;
margin: 0 0 2rem 0;
> p:first-child {
text-indent: 0;
strong {
font-size: 125%;
letter-spacing: -1px;
line-height: 0;
}
}
@media (max-width: 520px) {
columns: 1;
}
}
.in-brief {
text-align: center;
margin: 0 0 2rem 0;
h3 {
text-transform: uppercase;
text-align: center;
border-left: 1px solid #ccc;
border-right: 1px solid #ccc;
display: inline-block;
padding: 0 20px;
color: #999;
letter-spacing: 0.2rem;
font-size: 80%;
margin: 0;
background: white;
position: relative;
top: 1px;
}
}
.in-brief-content {
columns: 3;
font-size: 0.8rem;
text-align: left;
border: 1px solid #ccc;
padding: 20px;
@media (max-width: 520px) {
columns: 2;
}
}
h1 {
}
h2 {
font-family: 'Crimson Text', serif;
font-weight: 400;
}
h3 {
}
h4 {
font-family: 'Montserrat', sans-serif;
}
p {
text-indent: 2rem;
margin: 0;
}
.article-header {
padding: 0 50px;
margin: 0 0 30px 0;
}
.byline {
font-style: italic;
}
.article-body {
font-size: 0.9rem;
max-width: 500px;
margin: 0 auto;
h3 {
text-align: center;
text-transform: uppercase;
margin-top: 2rem;
}
}
figure {
margin: 1rem 0;
figcaption {
font-weight: bold;
letter-spacing: -0.03rem;
}
img {
margin: 0 0 5px 0;
}
}
img {
max-width: 100%;
display: block;
}
// No JavaScript here.
Also see: Tab Triggers