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 id="header">
<img id="header-img" src="https://www.shareicon.net/download/2017/04/14/883959_science_512x512.png" alt="logo"><h1>Coder Agent</h1>
<nav id="nav-bar">
<ul>
<li><a class="nav-link" href="#product-features">Features</a></li>
<li><a class="nav-link" href="#product-video">Watch it in action!</a></li>
<li><a class="nav-link" href="#product-prices">Prices</a></li>
</ul>
</nav>
</header>
<main>
<section class="email-subscription">
<h2>An AI agent that works for you and assists you during development</h2>
<form id="form" action="https://www.freecodecamp.com/email-submit">
<input id="email" type="email" name="email" placeholder="Enter your email address" required />
<input id="submit" class="btn" type="submit" value="Know more about the product" />
</form>
</section>
<section id="product-features">
<h2>What the coder agents can do for you...</h2>
<ul>
<li>Assist you while coding (acting as another dev on pair programming)</li>
<li>Execute manual tests as they were automatic (they should be well defined)</li>
<li>Help you estimate task difficulty and cost</li>
<li>Find bugs that only happen at runtime</li>
<li>Generate HTML templates and styles using an image (wireframe, drawn mockup) as reference</li>
<li>Lint any programming language</li>
<li>Suggest refactors for performance improvement</li>
<li>Suggest refactors for development velocity improvement</li>
<li>Generate deployment scripts based on simple instructions</li>
<li>Much more...</li>
</ul>
</section>
<section id="product-video">
<h2>Watch our agents in action!</h2>
<iframe id="video" width="560" height="315" src="https://www.youtube.com/embed/y3RIHnK0_NE" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</section>
<section id="product-prices">
<h2>Pricing</h2>
<div class="cards-container">
<div class="price-card">
<h3 class="price-card__title">Wall-E</h3>
<div class="price-card__price">$89.99 / month</div>
<div class="price-card__features">
<ul>
<li>Single-user license</li>
<li>9000 minutes of usage</li>
<li>$0.05/minute after monthly limit</li>
<li>Pair programming & Linting features</li>
<li>Task estimation features</li>
<li>Performance improvement features</li>
<li>Scripts generation features</li>
<li>Bug finding features</li>
</ul>
</div>
<button class="btn price-card__cta">Select</button>
</div>
<div class="price-card">
<h3 class="price-card__title">Bender</h3>
<div class="price-card__price">$859.99 / month</div>
<div class="price-card__features">
<ul>
<li>Single-user license</li>
<li>43k minutes of usage</li>
<li>$0.10/minute after monthly limit</li>
<li>All the features from Wall-E package plus...</li>
<li>Manual testing features</li>
<li>Template generation features</li>
<li>Development velocity improvement features</li>
</ul>
</div>
<button class="btn price-card__cta">Select</button>
</div>
<div class="price-card">
<h3 class="price-card__title">Skynet</h3>
<div class="price-card__price">$11k / month</div>
<div class="price-card__features">
<ul>
<li>Unlimited users license</li>
<li>Unlimited usage time</li>
<li>All the features from Wall-E & Bender packages plus...</li>
<li>API generation features</li>
<li>Database generation features</li>
<li>Auto TDD features</li>
<li>Bug auto-fixing features</li>
<li>Component generation features</li>
<li>Learning by monitoring features</li>
</u>
</div>
<button class="btn price-card__cta">Select</button>
</div>
</div>
</section>
</main>
<footer>
Copyright 2019, AI Trainers Inc
</footer>
* {
box-sizing: border-box;
}
body {
font-family: sans-serif;
background-color: #E0E5B1;
padding: 0 24px;
color: #333749;
}
header {
width: 100%;
position: fixed;
top: 0px;
left: 0px;
color: #EBECDF;
background-color: #333749;
max-height: 120px;
display: flex;
align-items: center;
flex-wrap: wrap;
padding: 0px 24px;
}
header img {
width: 48px;
height: 48px;
}
header h1 {
margin-left: 10px;
margin-right: auto;
}
header nav {
width: 320px;
margin-left: auto;
margin-right: 0;
}
header nav ul {
display: flex;
list-style: none;
justify-content: space-between;
width: 100%;
padding: 0;
}
a.nav-link, a.nav-link:visited {
color: #EBECDF;
}
a.nav-link:hover {
color: #769B92;
}
@media (min-width: 640px) {
header {
flex-wrap: nowrap;
}
}
main {
max-width: 1200px;
display: flex;
flex-direction: column;
margin: 120px auto;
}
section {
display: flex;
flex-direction: column;
align-items: center;
border-radius: 4px;
padding: 11px 24px 48px;
margin: 11px;
background-color: #EBECDF;
}
section ul {
list-style: none;
text-align: center;
padding: 0;
}
section ul li {
margin-bottom: 15px;
}
form {
display: flex;
flex-direction: column;
}
input[type="email"] {
padding: 11px;
font-family: monospace;
font-size: 16px;
margin-bottom: 15px;
border: 1px solid #769B92;
border-radius: 4px;
color: #769B92;
}
.btn {
padding: 11px;
color: #EBECDF;
font-weight: bold;
font-size: 18px;
border: 1px solid #769B92;
background-color: #769B92;
border-radius: 4px;
transition: all 0.1s ease;
}
.btn:hover, .btn:active {
border: 1px solid #769B92;
background-color: #EBECDF;
color: #769B92;
}
footer {
position: fixed;
width: 100%;
padding-bottom: 24px;
padding-right: 24px;
left: 0px;
bottom: 0px;
text-align: right;
}
.cards-container {
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: space-between;
}
@media (min-width: 990px) {
.cards-container {
flex-direction: row;
}
}
.price-card {
display: flex;
flex-direction: column;
min-width: 300px;
max-width: 30%;
min-height: 600px;
border-radius: 4px;
border: 1px solid #769B92;
padding: 16px 0;
}
.price-card .price-card__title {
text-align: center;
}
.price-card .price-card__price {
text-align: center;
font-size: 22px;
width: 100%;
background-color: #769B92;
color: #EBECDF;
padding: 11px;
}
.price-card .price-card__features {
display: flex;
flex-direction: column;
align-items: center;
}
.price-card__cta {
margin: auto;
margin-bottom: 0;
width: 80%;
}
Also see: Tab Triggers