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="container invoice">
<div class="invoice-header">
<div class="row">
<div class="col-xs-8">
<h1>Invoice <small>With Credit</small></h1>
<h4 class="text-muted">NO: 554775/R1 | Date: 01/01/2015</h4>
</div>
<div class="col-xs-4">
<div class="media">
<div class="media-left">
<img class="media-object logo" src="https://dummyimage.com/70x70/000/fff&text=ACME" />
</div>
<ul class="media-body list-unstyled">
<li><strong>Acme Corporation</strong></li>
<li>Software Development</li>
<li>Field 3, Moon</li>
<li>info@acme.com</li>
</ul>
</div>
</div>
</div>
</div>
<div class="invoice-body">
<div class="row">
<div class="col-xs-5">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Company Details</h3>
</div>
<div class="panel-body">
<dl class="dl-horizontal">
<dt>Name</dt>
<dd><strong>Acme Corporation</strong></dd>
<dt>Industry</dt>
<dd>Software Development</dd>
<dt>Address</dt>
<dd>Field 3, Moon</dd>
<dt>Phone</dt>
<dd>123.4456.4567</dd>
<dt>Email</dt>
<dd>mainl@acme.com</dd>
<dt>Tax NO</dt>
<dd class="mono">123456789</dd>
<dt>Tax Office</dt>
<dd>A' Moon</dd>
</div>
</div>
</div>
<div class="col-xs-7">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Customer Details</h3>
</div>
<div class="panel-body">
<dl class="dl-horizontal">
<dt>Name</dt>
<dd>Microsoft Corporation</dd>
<dt>Industry</dt>
<dd>Software Development</dd>
<dt>Address</dt>
<dd>One Microsoft Way Redmond, WA 98052-7329, USA</dd>
<dt>Phone</dt>
<dd>(425) 882-8080</dd>
<dt>Email</dt>
<dd>contact@microsoft.com</dd>
<dt>Tax NO</dt>
<dd class="mono">123456789</dd>
<dt> </dt>
<dd> </dd>
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Services / Products</h3>
</div>
<table class="table table-bordered table-condensed">
<thead>
<tr>
<th>Item / Details</th>
<th class="text-center colfix">Unit Cost</th>
<th class="text-center colfix">Sum Cost</th>
<th class="text-center colfix">Discount</th>
<th class="text-center colfix">Tax</th>
<th class="text-center colfix">Total</th>
</tr>
</thead>
<tbody>
<tr>
<td>
Lorem Ipsum Dolor
<br>
<small class="text-muted">The best lorem in town, try it now or leave forever</small>
</td>
<td class="text-right">
<span class="mono">$1,000.00</span>
<br>
<small class="text-muted">Before Tax</small>
</td>
<td class="text-right">
<span class="mono">$18,000.00</span>
<br>
<small class="text-muted">18 Units</small>
</td>
<td class="text-right">
<span class="mono">- $1,800.00</span>
<br>
<small class="text-muted">Special -10%</small>
</td>
<td class="text-right">
<span class="mono">+ $3,240.00</span>
<br>
<small class="text-muted">VAT 20%</small>
</td>
<td class="text-right">
<strong class="mono">$19,440.00</strong>
<br>
<small class="text-muted mono">$16,200.00</small>
</td>
</tr>
<tr>
<td>
Sit Amet Dolo
<br>
<small class="text-muted">Now you may sit</small>
</td>
<td class="text-right">
<span class="mono">$120.00</span>
<br>
<small class="text-muted">Before Tax</small>
</td>
<td class="text-right">
<span class="mono">$240.00</span>
<br>
<small class="text-muted">2 Units</small>
</td>
<td class="text-right">
<span class="mono">- $0.00</span>
<br>
<small class="text-muted">-</small>
</td>
<td class="text-right">
<span class="mono">+ $72.00</span>
<br>
<small class="text-muted">VAT:20% S:10%</small>
</td>
<td class="text-right">
<strong class="mono">$312.00</strong>
<br>
<small class="text-muted mono">$240.00</small>
</td>
</tr>
</tbody>
</table>
</div>
<div class="panel panel-default">
<table class="table table-bordered table-condensed">
<thead>
<tr>
<td class="text-center col-xs-1">Sub Total</td>
<td class="text-center col-xs-1">Discount</td>
<td class="text-center col-xs-1">Total</td>
<td class="text-center col-xs-1">Tax</td>
<td class="text-center col-xs-1">Final</td>
</tr>
</thead>
<tbody>
<tr>
<th class="text-center rowtotal mono">$18,240.00</th>
<th class="text-center rowtotal mono">-$1,800.00</th>
<th class="text-center rowtotal mono">$16,440.00</th>
<th class="text-center rowtotal mono">$3,312.00</th>
<th class="text-center rowtotal mono">$19,752.00</th>
</tr>
</tbody>
</table>
</div>
<div class="row">
<div class="col-xs-7">
<div class="panel panel-default">
<div class="panel-body">
<i>Comments / Notes</i>
<hr style="margin:3px 0 5px" /> Lorem ipsum dolor sit amet, consectetur adipisicing elit. Odit repudiandae numquam sit facere blanditiis, quasi distinctio ipsam? Libero odit ex expedita, facere sunt, possimus consectetur dolore, nobis iure amet vero.
</div>
</div>
</div>
<div class="col-xs-5">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Payment Method</h3>
</div>
<div class="panel-body">
<p>For your convenience, you may deposite the final ammount at one of our banks</p>
<ul class="list-unstyled">
<li>Alpha Bank - <span class="mono">MO123456789456123</span></li>
<li>Beta Bank - <span class="mono">MO123456789456123</span></li>
<li>Gamma Bank - <span class="mono">MO123456789456123</span></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="invoice-footer">
Thank you for choosing our services.
<br/> We hope to see you again soon
<br/>
<strong>~ACME~</strong>
</div>
</div>
body{
background:#EEE;
/* font-size:0.9em !important; */
}
.invoice{
width:970px !important;
margin:50px auto;
.invoice-header{
padding:25px 25px 15px;
h1{
margin:0
}
.media{
.media-body{
font-size:.9em;
margin:0;
}
}
}
.invoice-body{
border-radius:10px;
padding:25px;
background:#FFF;
}
.invoice-footer{
padding:15px;
font-size:0.9em;
text-align:center;
color:#999;
}
}
.logo{
max-height:70px;
border-radius:10px;
}
.dl-horizontal{
margin:0;
dt{
float: left;
width: 80px;
overflow: hidden;
clear: left;
text-align: right;
text-overflow: ellipsis;
white-space: nowrap;
}
dd{
margin-left:90px;
}
}
.rowamount{
padding-top:15px !important;
}
.rowtotal{
font-size:1.3em;
}
.colfix{
width:12%;
}
.mono{
font-family:monospace;
}
Also see: Tab Triggers