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="content"><div class="wrapper"><h1>Right click to toggle menu</h1><img src="http://www.adobewordpress.com/ads/300x250.jpg"><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris eleifend, erat non lacinia egestas, odio risus posuere leo, at tincidunt lorem orci accumsan ligula. Nam efficitur nunc non ex viverra viverra. Sed in sapien dictum, auctor tortor at, ornare magna. Ut sit amet nisi nisl. Nunc ex ligula, dictum a nisl eget, auctor posuere ante. Donec ut pellentesque arcu. In ac elit velit. Integer id eros ligula. Aenean gravida blandit magna, quis pellentesque diam malesuada sed. Donec nec rhoncus ex, sed varius libero. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque consectetur lobortis ex quis facilisis. In non turpis at neque facilisis congue a et lacus. Nunc vitae arcu vitae lectus vehicula feugiat. Pellentesque tincidunt lorem et odio porta, eget suscipit justo ultricies. Aenean auctor, mauris vitae pharetra sollicitudin, tellus sem sollicitudin augue, tempus vestibulum leo elit ut velit.</p><p>Proin eleifend ac enim ut efficitur. Maecenas justo tellus, consequat ac sem at, eleifend pulvinar ipsum. Cras odio odio, rutrum ut elit id, maximus mattis leo. Sed a tristique leo, sit amet viverra lectus. Ut ornare posuere mollis. Interdum et malesuada fames ac ante ipsum primis in faucibus. Cras rutrum eleifend aliquet. Mauris rhoncus aliquet dui, eget semper lectus pellentesque vitae. Nullam egestas malesuada mauris, sed porta massa sodales at.</p><p>Proin placerat, tellus sit amet ultricies ullamcorper, massa ante sodales neque, vel tincidunt ante ipsum quis ipsum. Maecenas vehicula suscipit ornare. Aenean dolor lorem, euismod in aliquet sit amet, egestas vel ipsum. Vivamus lobortis quis quam in sagittis. Aliquam id felis quam. Donec iaculis libero at orci commodo dictum. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Suspendisse molestie lacinia erat, ac euismod urna blandit id. Etiam molestie risus at ante porttitor, sit amet rutrum nisi pellentesque. Morbi eget placerat mauris. Etiam accumsan ac dui condimentum posuere. Integer viverra urna vel eros placerat, a pulvinar arcu rhoncus. Cras a purus et ante accumsan dictum eu ut augue.</p><p>Fusce eu arcu quis nulla vestibulum porttitor faucibus sed quam. Etiam justo augue, egestas ac varius scelerisque, ornare quis elit. Suspendisse quis luctus justo. Etiam finibus erat nibh, in varius sem dignissim quis. Phasellus eget nunc at risus scelerisque ultrices. Integer condimentum magna eget ipsum suscipit tempor. Vivamus ut orci justo. Sed lorem risus, sollicitudin quis tincidunt vitae, varius sed augue. Nunc egestas dapibus commodo. Proin sit amet eros quis augue suscipit cursus. Sed sit amet diam sollicitudin, laoreet orci eu, gravida ipsum. Vivamus eget massa risus.</p><p>Sed ac tellus justo. Etiam vitae aliquet leo. Etiam volutpat tellus mauris, posuere vestibulum augue bibendum quis. Nam eu interdum lacus. Proin id sem augue. Nunc dui nibh, congue in dictum tristique, egestas in turpis. In quis interdum mauris. Nam luctus lacinia dapibus. Quisque vehicula ligula eu enim commodo suscipit. Curabitur pulvinar justo ac massa mollis molestie. Nunc nec vulputate ex. Vivamus ullamcorper consectetur ex semper vulputate. Nunc metus elit, vestibulum eleifend odio sit amet, commodo suscipit sapien. Etiam eget quam nec leo blandit accumsan at nec mi. Fusce tortor est, dapibus id scelerisque et, interdum sit amet arcu. Etiam eget gravida dolor, eu iaculis tortor.</p><p>Fusce eu arcu quis nulla vestibulum porttitor faucibus sed quam. Etiam justo augue, egestas ac varius scelerisque, ornare quis elit. Suspendisse quis luctus justo. Etiam finibus erat nibh, in varius sem dignissim quis. Phasellus eget nunc at risus scelerisque ultrices. Integer condimentum magna eget ipsum suscipit tempor. Vivamus ut orci justo. Sed lorem risus, sollicitudin quis tincidunt vitae, varius sed augue. Nunc egestas dapibus commodo. Proin sit amet eros quis augue suscipit cursus. Sed sit amet diam sollicitudin, laoreet orci eu, gravida ipsum. Vivamus eget massa risus.</p><p>Sed ac tellus justo. Etiam vitae aliquet leo. Etiam volutpat tellus mauris, posuere vestibulum augue bibendum quis. Nam eu interdum lacus. Proin id sem augue. Nunc dui nibh, congue in dictum tristique, egestas in turpis. In quis interdum mauris. Nam luctus lacinia dapibus. Quisque vehicula ligula eu enim commodo suscipit. Curabitur pulvinar justo ac massa mollis molestie. Nunc nec vulputate ex. Vivamus ullamcorper consectetur ex semper vulputate. Nunc metus elit, vestibulum eleifend odio sit amet, commodo suscipit sapien. Etiam eget quam nec leo blandit accumsan at nec mi. Fusce tortor est, dapibus id scelerisque et, interdum sit amet arcu. Etiam eget gravida dolor, eu iaculis tortor.</p><p>Fusce eu arcu quis nulla vestibulum porttitor faucibus sed quam. Etiam justo augue, egestas ac varius scelerisque, ornare quis elit. Suspendisse quis luctus justo. Etiam finibus erat nibh, in varius sem dignissim quis. Phasellus eget nunc at risus scelerisque ultrices. Integer condimentum magna eget ipsum suscipit tempor. Vivamus ut orci justo. Sed lorem risus, sollicitudin quis tincidunt vitae, varius sed augue. Nunc egestas dapibus commodo. Proin sit amet eros quis augue suscipit cursus. Sed sit amet diam sollicitudin, laoreet orci eu, gravida ipsum. Vivamus eget massa risus.</p></div></div><div class="menubar">
<ul><li><a href="#"><i class="fa fa-home"></i> Home</a></li><li><a href="#"><i class="fa fa-check"></i> Content</a></li><li><a href="#"><i class="fa fa-database"></i> Data</a></li><li><a href="#"><i class="fa fa-envelope-o"></i> Contact</a></li></ul>
</div>
@import url(https://fonts.googleapis.com/css?family=Roboto:400,300&subset=latin,latin-ext);
*{transition:all .5s}
html {
overflow: hidden;
}
html,
body {
position: absolute;
height: 100%;
background-color:#e74c3c;
width:100%;
margin:0;
transform-origin: top left;
font:300 16px 'Roboto', sans-serif;
}
.content, .menubar{min-height:100%;}
.content{
position:absolute;
height:100%;
width:98%;
padding:1%;
background-color:white;
overflow-y:scroll;
border-radius:0 0 0 50px;
}
.menubar{
position:fixed;
width:100%;
left:-100%;
color:white;
text-align:right;
}
.menubar ul{
font:300 20px 'Roboto', sans-serif;
position:absolute;
bottom:0;right:0;
list-style:none;
}
.menubar ul li a{
display: block;
border:2px solid white;
padding:7px 14px;
margin:20px 15px;
text-align:left;
color:white;
text-decoration:none;
}
.menubar ul li a:hover{
background-color:rgba(1,1,1,.2)
}
.opacity{
opacity:.3;
}
.active{
transform: rotate(-20deg);
}
.content .wrapper{margin:0 1%}
.content .wrapper h1{
text-align:center;
border:2px solid #c0392b;
color:#c0392b;
padding:10px;
font-weight:300;
}
.content .wrapper img{
float:left;
margin:0 20px 10px 0;
}
.content .wrapper p{
padding:0;
margin:0 0 15px 0;
text-align:justify;
color:#2c3e50;
}
.content .wrapper p:first-of-type{
font-size:16px;
font-weight:400;
color:#34495e;
}
@media (max-width: 768px){
.content .wrapper img{width:100%; margin:0;}
.content .wrapper h1{font-size:90%;margin-top:50px;}
}
$(document).ready(function(){
document.oncontextmenu = function() {return false;};
$(document).mousedown(function(e){
if( e.button == 2 ) {
$('body').toggleClass('active');
$('.content .wrapper').toggleClass('opacity');
return false;
}
return true;
});
});
Also see: Tab Triggers