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 URL's 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 it's URL and the proper URL extention.
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 class="container">
<div class="content">
<!-- top container -->
<div class="inner-wrapper">
<div class="top-title">Oh!</div>
<div class="main-title">
4
<span class="svg-wrap">
<svg width="80px" height="80px" viewBox="0 0 40 42" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
<title>Lego head</title>
<defs>
<path id="path-1" d="M14.00976,6.04673974 C15.1748273,5.5908863 16,4.45702525 16,3.13043478 C16,1.40154339 14.5984566,0 12.8695652,0 C12.0080647,0 11.2278445,0.348002376 10.6618113,0.911100458 C10.5772973,0.939953572 10.4903214,0.971146886 10.4008152,1.00475543 C5.57957133,2.8150777 4.24944679,0.347826087 3.13043478,0.347826087 C1.40154339,0.347826087 0,1.74936948 0,3.47826087 C0,5.20715226 1.40154339,6.60869565 3.13043478,6.60869565 C4.46967336,6.60869565 12.3802688,6.97312235 14.00976,6.04673974 L14.00976,6.04673974 Z"></path>
</defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">
<g id="Lego-head" sketch:type="MSLayerGroup" transform="translate(1.000000, 1.000000)">
<g id="Lego">
<g id="404-Page">
<g id="Group">
<g id="Lego-head">
<rect id="head-bottom" stroke="#D8B140" stroke-width="2" fill="#F4CD3B" sketch:type="MSShapeGroup" x="9" y="29" width="20" height="11" rx="2"></rect>
<rect id="head-top" stroke="#D8B140" stroke-width="2" fill="#F4CD3B" sketch:type="MSShapeGroup" x="11" y="0" width="16" height="11" rx="2"></rect>
<rect id="head" stroke="#D8B140" stroke-width="2" fill="#F4CD3B" sketch:type="MSShapeGroup" x="0" y="4" width="38" height="32" rx="8"></rect>
<g id="mouth" transform="translate(11.000000, 23.000000)">
<g id="mask-2" fill="#FFFFFF" sketch:type="MSShapeGroup">
<path d="M14.00976,6.04673974 C15.1748273,5.5908863 16,4.45702525 16,3.13043478 C16,1.40154339 14.5984566,0 12.8695652,0 C12.0080647,0 11.2278445,0.348002376 10.6618113,0.911100458 C10.5772973,0.939953572 10.4903214,0.971146886 10.4008152,1.00475543 C5.57957133,2.8150777 4.24944679,0.347826087 3.13043478,0.347826087 C1.40154339,0.347826087 0,1.74936948 0,3.47826087 C0,5.20715226 1.40154339,6.60869565 3.13043478,6.60869565 C4.46967336,6.60869565 12.3802688,6.97312235 14.00976,6.04673974 L14.00976,6.04673974 Z" id="path-1"></path>
</g>
<g id="Mask" fill="#3D3D3D" sketch:type="MSShapeGroup">
<path d="M14.00976,6.04673974 C15.1748273,5.5908863 16,4.45702525 16,3.13043478 C16,1.40154339 14.5984566,0 12.8695652,0 C12.0080647,0 11.2278445,0.348002376 10.6618113,0.911100458 C10.5772973,0.939953572 10.4903214,0.971146886 10.4008152,1.00475543 C5.57957133,2.8150777 4.24944679,0.347826087 3.13043478,0.347826087 C1.40154339,0.347826087 0,1.74936948 0,3.47826087 C0,5.20715226 1.40154339,6.60869565 3.13043478,6.60869565 C4.46967336,6.60869565 12.3802688,6.97312235 14.00976,6.04673974 L14.00976,6.04673974 Z" id="path-1"></path>
</g>
<g id="Oval-25-Clipped">
<mask id="mask-2" sketch:name="path-1" fill="white">
<use xlink:href="#path-1"></use>
</mask>
<g id="path-1"></g>
<path d="M2.90917969,7.67480469 C5.90917969,9.95019531 8.99755822,7.576474 8.99755822,6.74804688 C8.99755822,5.91961975 6.209139,4 4,4 C1.790861,4 2.8444044e-16,4.67157288 2.8444044e-16,5.5 C2.8444044e-16,6.32842712 -0.0908203125,5.39941406 2.90917969,7.67480469 L2.90917969,7.67480469 Z" id="Oval-25" fill="#EA6767" sketch:type="MSShapeGroup" mask="url(#mask-2)"></path>
</g>
</g>
<circle id="e-r" fill="#3D3D3D" sketch:type="MSShapeGroup" cx="13.5" cy="18.5" r="2.5"></circle>
<circle id="e-l" fill="#3D3D3D" sketch:type="MSShapeGroup" cx="22.5" cy="18.5" r="2.5"></circle>
<path d="M9,15.7883986 C9,15.7883986 11.0517578,11.8870314 13.6416016,13.3137892" id="e-l" stroke="#3D3D3D" sketch:type="MSShapeGroup" transform="translate(11.320801, 14.394199) scale(-1, -1) translate(-11.320801, -14.394199) "></path>
<path d="M26.6416016,15.7883986 C26.6416016,15.7883986 24.5898438,11.8870314 22,13.3137892" id="e-r" stroke="#3D3D3D" sketch:type="MSShapeGroup" transform="translate(24.320801, 14.394199) scale(-1, -1) translate(-24.320801, -14.394199) "></path>
</g>
</g>
</g>
</g>
</g>
</g>
</svg>
</span>
4
</div>
</div>
<!-- bottom-tagline -->
<p class="blurb">
The page you were looking for doesn't exist.<br/>
Return to
<a href="#">homepage</a>
or explore
</p>
<a href="#" class="lego-btn">Lego World</a>
</div>
</div>
/* ==========================================================================
Base Styles - ! HTML5 Boilerplate v5.0 | MIT License | http://h5bp.com/
========================================================================== */
html,
body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
::-moz-selection {
background: #b3d4fc;
text-shadow: none;
}
::selection {
background: #b3d4fc;
text-shadow: none;
}
a{
color: #4384F5;
text-decoration: none;
}
a:hover{
opacity: 0.8;
}
svg {
vertical-align: middle;
}
/* ==========================================================================
Main Styles
========================================================================== */
.container {
display: table;
font-family: 'Open Sans', sans-serif;
height: 100%;
width: 100%;
background: #fff;
}
.content{
display: table-cell;
font-size: 22px;
text-align: center;
vertical-align: middle;
padding: 40px 30px;
}
.inner-wrapper{
display: inline-block;
}
.top-title{
color: #4384F5;
font-size: 35px;
font-weight: 700;
margin-bottom: 25px;
}
.main-title{
line-height: 0;
font-size: 90px;
font-weight: 800;
color: #4384F5;
}
.svg-wrap{
display: inline-block;
font-size: 0;
vertical-align: super;
}
#lego{
padding: 5px;
}
.blurb{
margin-top: 30px;
color: #B6BECC;
}
.lego-btn{
background: #4384F5;
border-radius: 4px;
color: #fff;
display: inline-block;
margin-top: 30px;
padding: 12px 25px;
}
/* ==========================================================================
Media Queries
========================================================================== */
@media only screen and (max-width: 440px){
.main-title{
font-size: 60px;
}
#lego{
width: 50px;
height: 55px;
padding: 10px 5px;
}
.blurb,
.lego-btn{
font-size: 18px;
}
}
Also see: Tab Triggers