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 id="header">
<h1>The Designer's Weblog</h1>
<ul class="nav">
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Portfolio</a></li>
<li><a href="#">Contact</a></li>
</ul>
</div>
<div id="container">
<span class="tl"></span><span class="tr"></span>
<div class="post">
<h2>Rounded Corners in "Just" 40 Lines of Code</h2>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Inventore nostrum vero minima minus delectus, magni facere velit mollitia!</p>
<p>
<h3>Design Inspiration for this Week's Challenge</h3>
<ul>
<li><a href="https://www.smashingmagazine.com/2008/02/45-more-excellent-blog-designs/">45 More Excellent Blog Designs</a> from Smashing Magazine, 2008</li>
<li><a href="https://www.webdesignmuseum.org/flash-websites/page/2/style/Grunge,Y2K%20Aesthetic,Paper">Grunge, y2k aesthetic, and paper texture designs from 2000-2009</a> at the Web Design Museum</li>
<li><a href="https://thefwa.com/cases/flowers-feed-the-soul">Flowers Feed the Soul</a> at The Favorite Website Awards, 2006</li>
</ul>
</p>
<p class="explain"> I reallly struggled to get websites to line up using the technology of 2008. My bible at that time was <a href="http://handcraftedcss.com/">Handcrafted CSS</a> <cite>by DAN CEDERHOLM with ETHAN MARCOTTE</cite>. As mostly a coder and not a designer I didn't want some prebuilt drag and drop solution. I like to write every bit of code that is there. They helped me do that. PS their site is a time capsule of 2008</p>
<p> Iusto cumque quasi ratione modi fugiat necessitatibus corporis, magnam, veniam molestias voluptatum expedita dolorum, ullam recusandae optio officiis molestiae quidem provident porro architecto hic perferendis consequuntur dicta. Dolorem laboriosam ipsa ipsum minus minima quibusdam quam sunt nulla eaque neque et soluta explicabo deleniti dolore, dolor quia est nam eos, quod, optio quis. Velit in animi harum quidem amet tenetur dignissimos quis recusandae sunt corrupti error rem vero, quae libero veritatis asperiores voluptates.</p>
<h3>Fire Up Photoshop, It's Skeumorphin' Time</h3>
<p>Cupiditate odit laborum exercitationem ut veniam enim, aut officia aspernatur, cumque ipsam voluptatibus neque architecto voluptatum! Doloremque voluptate dolore pariatur illum aliquid sed minima autem sunt! Aspernatur rem doloremque enim magnam, cupiditate beatae, quae ea odio eius ducimus vel fuga esse dolorum ut commodi consequuntur! Similique in animi rem minus dicta impedit quaerat nemo! Tempore, in. Ut veniam temporibus, ratione iste odio ipsa consectetur blanditiis repellat maxime? Facilis nisi eius voluptatem.</p>
<p>Totam aspernatur dolores sunt, cumque corporis mollitia explicabo eveniet numquam consequuntur facere possimus distinctio ratione voluptatum tempore beatae! Eligendi quas quae aliquam quasi sapiente? Ad dolor mollitia, facilis veniam necessitatibus possimus quam illo nihil nostrum beatae voluptatem consequuntur recusandae odio itaque sit culpa porro obcaecati harum nobis accusantium et incidunt? Quam voluptatem voluptas aliquid asperiores, aspernatur voluptatibus ex atque nihil fuga nesciunt sit accusantium nisi magni doloribus!</p>
<h3>If your web design doesn't have a paper texture, is it really design?</h3>
<p> Laboriosam cumque quam delectus earum voluptatibus aliquam perspiciatis maxime minima ipsum repellendus magnam dolorum ad provident, alias inventore sit quo reiciendis ex odio. Quae est distinctio atque officiis id soluta impedit eius odio deserunt modi. Odit unde labore error cupiditate, dicta soluta repellendus esse adipisci molestias culpa numquam quae itaque voluptatum, officia voluptatem saepe placeat nihil, dolor dolores omnis aut? Eveniet unde blanditiis recusandae eaque voluptate voluptas fugit neque veniam! Earum cumque itaque maxime hic illo unde eius architecto omnis nisi ab ea repudiandae magnam delectus sunt tempore placeat aperiam, facere possimus numquam soluta quidem deserunt dolores voluptates. Consectetur provident deserunt quis! Quidem nemo ullam expedita a rem dolor modi sit aliquam, vitae adipisci quibusdam consequatur voluptates, voluptatem consectetur at ex commodi facere molestias natus repellat ipsa. Eius maxime, est, accusamus aspernatur laudantium, quam fuga unde consequuntur non corrupti iste eligendi. Omnis, accusantium accusamus? Hic aspernatur error ullam, nostrum molestiae beatae cumque facilis quo voluptatem. Suscipit eligendi magnam adipisci.</p>
<p>Molestias commodi quaerat debitis eos voluptas voluptatum corporis nisi libero magnam facilis sapiente tempora eligendi, nulla asperiores sunt blanditiis sequi aperiam molestiae! Quo tenetur vitae voluptatibus corrupti necessitatibus neque nulla a, accusantium repellat provident. Exercitationem maiores nam animi dolore impedit provident vero debitis libero ducimus necessitatibus rerum quisquam esse ex, doloremque voluptatem quam aliquid. Repudiandae, numquam! Fugiat aut ad ipsa explicabo ut laboriosam molestiae corrupti quidem! Quis natus blanditiis iusto facilis odit!</p>
<h3>Here comes CSS3!</h3>
<p>Molestias commodi quaerat debitis eos voluptas voluptatum corporis nisi libero magnam facilis sapiente tempora eligendi, nulla asperiores sunt blanditiis sequi aperiam molestiae! Quo tenetur vitae voluptatibus corrupti necessitatibus neque nulla a, accusantium repellat provident. Exercitationem maiores nam animi dolore impedit provident vero debitis libero ducimus necessitatibus rerum quisquam esse ex, doloremque voluptatem quam aliquid. Repudiandae, numquam! Fugiat aut ad ipsa explicabo ut laboriosam molestiae corrupti quidem! Quis natus blanditiis iusto facilis odit!</p>
</div>
<div class="flair1" role="presentation"></div>
<div class="flair2" role="presentation"></div>
<div class="flair3" role="presentation"></div>
<div class="flair4" role="presentation"></div>
<div class="flair5" role="presentation"></div>
<div class="extra6" role="presentation"></div>
<span class="bl"></span><span class="br"></span>
</div>
/* rounded corner technique from Dave Woods, 2008: https://www.dave-woods.co.uk/css-rounded-corners-revisited/ */
* {
padding: 0;
margin: 0;
}
html {
overflow-y: scroll;
background: linear-gradient(to bottom, #f9f6de, #6e6e65);
}
body {
font-family: Georgia, serif;
margin: auto;
width: 750px;
padding: 10px;
color: black;
background: linear-gradient(to bottom, #f9f6de, #6e6e65);
}
#header {
background-color: #eaeacf;
border-top: 4px solid #c4c3a7;
border-radius: 20px;
}
#header h1 {
margin: 10px 10px 0 0;
text-align: end;
text-transform: uppercase;
font-size: 30px;
}
#header .nav {
display: flex;
gap: 5px;
justify-content: left;
margin-block-start: 20px;
list-style: none;
}
#header .nav li {
background-color: #d4d5ad;
padding: 10px 30px;
border-radius: 10px 10px 0px 0px;
color: #898859;
cursor: pointer;
transition: 1s ease;
}
#header .nav li:hover {
background-color: #898959;
color: #d4d5ad;
}
#header .nav a {
text-decoration: none;
color: inherit;
}
#container {
/* background-color: #247cba; */
background-color: #eaeacf;
width: 750px;
overflow: hidden;
outline: 1px solid brown;
outline-offset: -10px;
border-radius: 20px;
}
#container h1,
h2 {
clear: both;
text-align: center;
padding: 5px 0;
}
h3 {
padding: 0 0 10px 0;
}
.post {
width: 700px;
margin: 0 auto;
background-color: #f6f8e0;
margin: 30px auto;
padding: 5px;
border-radius: 15px;
}
.post p {
padding: 10px;
}
.explain:hover {
background: rgb(89, 56, 56);
color: #f6f8e0;
}
ul {
padding: 0 20px;
}
p::first-letter {
font-size: 24px;
}
/* .tl {
background-image: url(https://assets.codepen.io/652/circle.gif);
width: 10px;
height: 10px;
float: left;
font-size: 0;
}
.tr {
background-image: url(https://assets.codepen.io/652/circle.gif);
background-position: 10px 0px;
width: 10px;
height: 10px;
float: right;
font-size: 0;
}
.bl {
background-image: url(https://assets.codepen.io/652/circle.gif);
background-position: 0px 10px;
width: 10px;
height: 10px;
float: left;
font-size: 0;
}
.br {
background-image: url(https://assets.codepen.io/652/circle.gif);
background-position: 10px 10px;
width: 10px;
height: 10px;
float: right;
font-size: 0;
} */
Also see: Tab Triggers