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="column twelve last buffer-bottom"></div> <!-- Just making some room -->
<div id="container" class="column twelve last">
<div class="row relative">
<div id="123456789012-meta" class="column ten push-one last absolute buffer hidden meta">
<div class="column twelve last text-center">
February 6 2014 | 123456789012
</div>
<div class="column twelve last buffer-bottom"></div> <!-- Just making some room -->
<div class="column six buffer-left address billing no-wrap no-overflow ellipsis">
Billing Company Name<br />
Billing Name<br />
Billing Address<br />
City, State Postal Code Country
</div>
<div class="column six last buffer-left address shipping no-wrap no-overflow ellipsis">
Shipping Company Name<br />
Shipping Name<br />
Shipping Address<br />
City, State Postal Code Country
</div>
<div class="column twelve last buffer-top"></div> <!-- Just making some room -->
<div class="column six buffer-left contact">
<span>P:</span> 206-555-5555<br />
<span>E:</span> address@domain.com
</div>
<div class="column six last buffer-left">
Via FedEx Ground
</div>
<div class="column twelve last buffer-top"><hr /></div> <!-- Just making some room -->
<div class="column twelve last">
<table class="squeeze no-wrap no-overflow ellipsis">
<tr>
<th>Qty.</th>
<th>P/N</th>
<th>Desc.</th>
<th>Price</th>
</tr>
<tr>
<td>50</td>
<td>1234-567</td>
<td>Product Description</td>
<td>$19.95</td>
</tr>
</table>
</div>
<div class="column twelve last"><hr /></div> <!-- Just making some room -->
<div class="column twelve last text-center">
<button type="button" class="bg-red">Unclaim</button>
<button type="button" class="bg-blue">Notes</button>
<button type="button" class="bg-green">Enter Order</button>
</div>
<div class="column twelve last buffer-left">
<h4>Customer Notes/Feedback</h4>
<p>
Customers could enter notes and supply feedback when they placed their orders. Its first appearance in the order entry process is here.
</p>
</div>
</div>
<div id="123456789012" class="row-content orderup">
<div class="column twelve last header">
<div class="column three">
<span class="emph">06 February</span> 2015
</div>
<div class="column three">
123456789012
</div>
<div class="column six last note no-overflow no-wrap ellipsis">
2/6/2015: Order notes show up here if a sales person enters one.
</div>
</div>
<div class="column six buffer cname">
<span class="emph">B</span> Billing Company Name
</div>
<div class="column six buffer last cname">
<span class="emph">S</span> Ship-To Company Name
</div>
<div class="column three status new emph text-center">
NEW
</div>
<div class="column three owner you text-right">
Owned by You
</div>
<div class="column three right last total text-center">
$1234.57
</div>
</div>
</div>
</div>
@import url(https://fonts.googleapis.com/css?family=Roboto:300);
body {
background-color: #fff;
font-family: Roboto;
overflow-y: scroll;
}
.no-wrap {
white-space: nowrap;
}
.no-overflow {
overflow: hidden;
}
.ellipsis {
text-overflow: ellipsis
}
.text-center {
text-align: center;
}
.text-right {
text-align: right;
}
.emph {
font-weight: bold;
font-size: 115%;
}
.orderup {
max-width: 60em;
margin: 20px auto 10px;
background-color: #fff;
border-radius: 3px;
border: 1px solid #d8d8d8;
box-bottom-width: 2px;
cursor: pointer;
transition: 100ms ease-out;
z-index: 0;
}
.orderup.active {
box-shadow: 5px 5px 5px #ccc;
transform: translate(-5px, -5px);
z-index: 100;
}
.orderup.active .header {
background-color: #192b80;
}
.orderup .header {
padding: 9px;
background-color: #5e6aa6;
color: #fff;
transition: 100ms ease-out;
}
.orderup:hover .header {
background-color: #192b80;
}
.orderup .header .note {
font-style: italic;
}
.status.new {
color: #080;
}
.owner {
color: #666;
}
.total {
color: #080;
}
.cname {
font-size: 120%;
color: #3d4987;
}
.cname span {
color: #ccc;
}
.meta {
top: 100%;
margin-top: -2em;
background: #fff;
border-radius: 3px;
border: 1px solid #d8d8d8;
border-bottom: 2px;
transition: 200ms ease-out;
transform-origin: center top;
transform: scale(1.0, 0.01);
z-index: 0;
}
var order = [];
function activateOrder(id) {
$('#'+id).addClass('active');
$('#'+id+'-meta').fadeIn(150);
$('#'+id+'-meta').css('transform', 'scale(1.0, 1.0)');
}
function deactivateOrder(id) {
$('#'+id).removeClass('active');
$('#'+id+'-meta').fadeOut(100);
$('#'+id+'-meta').css('transform', 'scale(1.0, 0.01)');
}
$('.orderup').on('click', function() {
if ( $('.orderup').hasClass('active') ) {
deactivateOrder( $('.active').attr('id') );
}
else if( !$('.orderup').hasClass('active') ) {
activateOrder( $(this).attr('id') );
}
});
$('.orderup a, .orderup button').on('click', function(e) {
e.stopPropagation();
});
Also see: Tab Triggers