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="flip-container">
<div class="flipper">
<div class="front">
<div id="header" class="clearfix">
<div id="logo">
Flip Dialog
</div>
<div id="menu">
<ul>
<li>
<a href="#">Click me</a>
</li>
<li>
<a href="#">Me too</a>
</li>
<li>
<a href="#">Don't click me</a>
</li>
<li>
<a href="#">i love you</a>
</li>
</ul>
</div>
</div>
<div id="banner-wrap" class="clearfix">
<div id="banner" class="panel">
<div id="banner-header" class="metal">
<div class="nav">
<div class="dot act"></div>
<div class="dot"></div>
<div class="dot"></div>
</div>
</div>
<div id="banner-content">
<div class="text0">
Flipping
</div>
<div class="text1">
By <a href="http://twitter.blazeboy.me">@blaz_boy</a>
</div>
<div class="text3">
An awesome flip
<br/>
Dialog concept
</div>
<div class="text4">
FLIP
</div>
</div>
</div>
</div>
<div id="bottom" class="clearfix">
<div class="column panel metal">
<h2>Lorem ipsum</h2>
<p>
Ut bibendum elit in tellus convallis luctus. Ut porttitor <a href="#">eleifend hendrerit</a>. Maecenas elit tortor, consequat non euismod tincidunt, luctus sit amet justo. Ut eget odio at metus rhoncus porta vitae porta justo. Ut tristique lobortis molestie. Morbi mollis ornare lectus, at tristique sapien ultricies pretium.
<button class="large-buttons">Click me</button>
</p>
</div>
<div class="column panel metal">
<h2>Dolor sit</h2>
<p>
Nunc ullamcorper <a href="#">lacinia</a> nibh non venenatis. Donec nec augue risus, sed aliquet urna. Donec ullamcorper. Morbi mollis ornare lectus, at tristique sapien ultricies pretium. Erat eget consectetur commodo, magna sem egestas felis, a fringilla diam erat a dui aliquam ac luctus.
<button class="large-buttons">Click me</button>
</p>
</div>
<div class="column panel metal last">
<h2>Lorem ipsum</h2>
<p>
Ut bibendum elit in tellus convallis luctus. Ut porttitor eleifend hendrerit. Maecenas elit tortor, consequat non euismod tincidunt, luctus sit amet justo. Ut eget odio at metus rhoncus porta vitae porta justo. Ut tristique lobortis molestie. Morbi mollis ornare lectus, at tristique sapien ultricies pretium.
</p>
<button class="large-buttons">Click me</button>
</div>
</div>
<div id="footer">
<div class="content">
This page template credit to <span class="rigth"><a href="mailto:mbielanczuk@gmail.com">mbielanczuk@gmail.com, 2012</a></span>
</div>
</div>
</div>
<div class="back">
<div class="flip-modal">
<p></p>
<div class="right"><button>OK</button></div>
</div>
</div>
</div>
</div>
@import url(https://fonts.googleapis.com/css?family=Squada+One);
@import url(https://fonts.googleapis.com/css?family=Fredericka+the+Great);
@import url(https://fonts.googleapis.com/css?family=Simonetta);
@import url(https://fonts.googleapis.com/css?family=Holtwood+One+SC);
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html, body {
height: 100%;
}
body {
font-family: Arial, sans-serif;
font-size: 14px;
color: #444;
background-color: #DDD;
}
::selection {
background: #ff5555;
}
::-moz-selection {
background: #ff5555;
}
h1, h2, h3, h4, h5 {
color: #444;
text-shadow: 0 1px 0px #fff;
}
.clearfix:before, .clearfix:after {
content: "";
display: table;
}
.clearfix:after {
clear: both;
}
.clearfix {
*zoom: 1;
}
a:link, a:active, a:visited {
color: #51749C;
text-decoration: none;
}
a:hover {
color: #ff5555;
}
#header {
display: block;
width: 1024px;
height: 49px;
padding: 0;
margin: 15px auto;
border-top: 1px solid #CCC;
background-color: #444;
background: -webkit-linear-gradient(#444, #333);
background: -moz-linear-gradient(#444, #333);
background: -o-linear-gradient(#444, #333);
background: -ms-linear-gradient(#444, #333);
background: linear-gradient(#444, #333);
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
-webkit-box-shadow: 0 1px 3px #666;
-moz-box-shadow: 0 1px 3px #666;
box-shadow: 0 1px 3px #666;
}
#header #logo {
margin-top: 12px;
float: left;
width: 150px;
height: 75px;
}
#header #menu {
float: right;
overflow: auto;
margin-right: 20px;
}
#header #menu ul {
list-style: none;
display: block;
float: right;
}
#header #menu li {
font-family: 'Squada One';
letter-spacing: 1px;
float: left;
line-height: 49px;
padding: 0 20px;
border-left: 1px solid #333;
box-shadow: inset 2px 0 2px -2px #666;
-webkit-box-shadow: inset 2px 0 2px -2px #666;
-moz-box-shadow: inset 2px 0 2px -2px #666;
}
#header #menu ul li a:link, #header #menu ul li a:visited, #header #menu ul li a:active {
font-size: 14px;
color: #D0D0D0;
text-transform: uppercase;
text-align: center;
text-shadow: 1px 1px 0px #000;
}
#header #menu ul li a:hover {
color: #fff;
text-shadow: none;
}
.panel {
padding: 0;
background-color: #fff;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
-webkit-box-shadow: 0 1px 3px #666;
-moz-box-shadow: 0 1px 3px #666;
box-shadow: 0 1px 3px #666;
}
.metal {
-webkit-border-top-left-radius: 3px;
-webkit-border-top-right-radius: 3px;
-moz-border-radius-topleft: 3px;
-moz-border-radius-topright: 3px;
border-top-left-radius: 3px;
border-top-right-radius: 3px;
border-top: 1px solid #fff;
background: -webkit-linear-gradient(#fff, #ddd);
background: -moz-linear-gradient(#ededed, #ddd);
background: -o-linear-gradient(#ededed, #ddd);
background: -ms-linear-gradient(#ededed, #ddd);
background: linear-gradient(#fff, #000);
}
#banner-wrap {
width: 100%;
padding: 50px 0 0;
}
#banner {
margin: 0 auto;
display: block;
width: 1024px;
height: 380px;
}
#banner-header {
padding: 10px;
height: 45px;
}
#banner-header .nav {
width: 70px;
height: 25px;
margin: 0 auto;
padding: 0 5px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
background-color: #EEE;
-webkit-box-shadow: inset 0 0 5px #888, 0 1px 1px #fff;
-moz-box-shadow: inset 0 0 5px #888, 0 1px 1px #fff;
-ms-box-shadow: inset 0 0 5px #888, 0 1px 1px #fff;
-o-box-shadow: inset 0 0 5px #888, 0 1px 1px #fff;
box-shadow: inset 0 0 5px #888, 0 1px 1px #fff;
}
#banner-header .nav .dot {
float: left;
width: 9px;
height: 9px;
margin: 8px 5px;
background-color: #999;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
border-radius: 50%;
-webkit-box-shadow: 0 1px 0 #fff;
-moz-box-shadow: 0 1px 0 #fff;
-ms-box-shadow: 0 1px 0 #fff;
-o-box-shadow: 0 1px 0 #fff;
box-shadow: 0 1px 0 #fff;
}
#banner-header .nav .act {
background-color: #777;
}
#banner-content {
-webkit-box-shadow: inset 0px 4px 9px -5px #444;
box-shadow: inset 0px 4px 9px -5px #444;
-moz-box-shadow: inset 0px 4px 9px -5px #444;
-ms-box-shadow: inset 0px 4px 9px -5px #444;
-o-box-shadow: inset 0px 4px 9px -5px #444;
padding: 0;
height: 100%;
color: #4477ff;
text-align: center;
position: relative;
overflow: hidden;
}
#banner-content .text0 {
font-family: 'Fredericka the Great';
font-size: 60px;
color: #445566;
-moz-transform: scale(1) rotate(90deg) translateX(110px) translateY(-350px) skewX(0deg) skewY(0deg);
-webkit-transform: scale(1) rotate(90deg) translateX(110px) translateY(-350px) skewX(0deg) skewY(0deg);
-o-transform: scale(1) rotate(90deg) translateX(110px) translateY(-350px) skewX(0deg) skewY(0deg);
-ms-transform: scale(1) rotate(90deg) translateX(110px) translateY(-350px) skewX(0deg) skewY(0deg);
transform: scale(1) rotate(90deg) translateX(110px) translateY(-350px) skewX(0deg) skewY(0deg);
}
#banner-content .text1 {
font-family: 'Simonetta';
font-size: 40px;
font-style: italic;
color: #6688ff;
-moz-transform: scale(1) rotate(0deg) translateX(85px) translateY(180px) skewX(0deg) skewY(0deg);
-webkit-transform: scale(1) rotate(0deg) translateX(85px) translateY(180px) skewX(0deg) skewY(0deg);
-o-transform: scale(1) rotate(0deg) translateX(85px) translateY(180px) skewX(0deg) skewY(0deg);
-ms-transform: scale(1) rotate(0deg) translateX(85px) translateY(180px) skewX(0deg) skewY(0deg);
transform: scale(1) rotate(0deg) translateX(85px) translateY(180px) skewX(0deg) skewY(0deg);
}
#banner-content .text2 {
font-family: 'Squada One';
color: #999;
font-size: 22px;
-moz-transform: scale(1) rotate(45deg) translateX(0px) translateY(0px) skewX(0deg) skewY(0deg);
-webkit-transform: scale(1) rotate(-90deg) translateX(-37px) translateY(310px) skewX(0deg) skewY(0deg);
-o-transform: scale(1) rotate(-90deg) translateX(0px) translateY(0px) skewX(0deg) skewY(0deg);
-ms-transform: scale(1) rotate(-90deg) translateX(0px) translateY(0px) skewX(0deg) skewY(0deg);
transform: scale(1) rotate(-90deg) translateX(0px) translateY(0px) skewX(0deg) skewY(0deg);
}
#banner-content .text3 {
font-family: 'Holtwood One SC';
font-size: 62px;
text-align: right;
line-height: 62px;
color: #444;
-moz-transform: scale(1) rotate(0deg) translateX(-230px) translateY(-15px) skewX(0deg) skewY(0deg);
-webkit-transform: scale(1) rotate(0deg) translateX(-230px) translateY(-15px) skewX(0deg) skewY(0deg);
-o-transform: scale(1) rotate(0deg) translateX(-230px) translateY(-15px) skewX(0deg) skewY(0deg);
-ms-transform: scale(1) rotate(0deg) translateX(-230px) translateY(-15px) skewX(0deg) skewY(0deg);
transform: scale(1) rotate(0deg) translateX(-230px) translateY(-15px) skewX(0deg) skewY(0deg);
}
#banner-content .text4 {
font-family: 'Holtwood One SC';
font-size: 110px;
text-align: right;
color: #777;
-moz-transform: scale(1) rotate(0deg) translateX(-230px) translateY(-280px) skewX(0deg) skewY(0deg);
-webkit-transform: scale(1) rotate(0deg) translateX(-230px) translateY(-280px) skewX(0deg) skewY(0deg);
-o-transform: scale(1) rotate(0deg) translateX(-230px) translateY(-280px) skewX(0deg) skewY(0deg);
-ms-transform: scale(1) rotate(0deg) translateX(-230px) translateY(-280px) skewX(0deg) skewY(0deg);
transform: scale(1) rotate(0deg) translateX(-230px) translateY(-280px) skewX(0deg) skewY(0deg);
}
#bottom {
width: 1024px;
margin: 30px auto;
padding: 0 0;
position: relative;
}
#bottom .column p {
margin: 10px 0;
text-align: justify;
text-indent: 20px;
}
#bottom .column {
width: 320px;
padding: 20px;
float: left;
margin: 0 32px 30px 0;
}
#bottom .last {
margin: 0 0 30px;
}
#footer {
width: 100%;
height: 150px;
background-color: #444;
}
#footer .content {
font-size: 12px;
width: 1024px;
color: #EEE;
margin: 0 auto;
padding: 15px 0 0;
}
#footer .content a:link, #footer .content a:visited, #footer .content a:active {
color: #88AADD;
text-shadow: 1px 1px 0px #000;
}
#footer .content a:hover {
color: #ff5555;
text-shadow: none;
}
/**
* flip card css credit to David walsh
* http://davidwalsh.name/css-flip
*/
.flip-container {
-webkit-perspective: 1000;
-moz-perspective: 1000;
-o-perspective: 1000;
perspective: 1000;
}
/* flip the pane when hovered */
.flip-container.hover .flipper, .flip-container.hover .flipper {
-webkit-transform: rotateY(180deg);
-moz-transform: rotateY(180deg);
-o-transform: rotateY(180deg);
transform: rotateY(180deg);
}
.flip-container, .front, .back {
width: 100%;
}
/* flip speed goes here */
.flipper {
-webkit-transition: 0.6s;
-webkit-transform-style: preserve-3d;
-moz-transition: 0.6s;
-moz-transform-style: preserve-3d;
-o-transition: 0.6s;
-o-transform-style: preserve-3d;
transition: 0.6s;
transform-style: preserve-3d;
position: relative;
}
/* hide back of pane during swap */
.front, .back {
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
-o-backface-visibility: hidden;
backface-visibility: hidden;
position: absolute;
top: 0;
left: 0;
}
/* front pane, placed above back */
.front {
z-index: 2;
}
/* back, initially hidden pane */
.back {
-webkit-transform: rotateY(180deg);
-moz-transform: rotateY(180deg);
-o-transform: rotateY(180deg);
transform: rotateY(180deg);
}
/**
* back extra styling
*/
.back {
background-color: #252326;
background: url('http://fc08.deviantart.net/fs42/f/2009/070/1/c/Purple_Blur__a_wallpaper_by_Sostopher.jpg') center center scroll;
}
/**
* modal style
*/
.flip-modal{
width: 500px;
margin: 100px auto;
padding: 20px;
background: #fefefe;
border-radius: 3px;
box-shadow: 0px 0px 0px 5px rgba(255,255,255,0.3);
}
.flip-modal p{
margin: 20px;
font: 15px Arial, Helvetica, sans-serif;
}
.flip-modal button{
padding: 7px 30px;
background: #888888;
color: white;
border: 0px none;
border-radius: 3px;
cursor: pointer;
}
.flip-modal .right{
text-align: right;
}
/**
* large buttons style
*/
.large-buttons{
padding: 10px 30px;
font: 15px Arial;
display: block;
background: #51749C;
color: #FFFFFF;
border: 0px none;
border-radius: 5px;
margin: 30px auto;
cursor: pointer;
}
/**
* @author http://blazeboy.me
*/
function flip_dialog(message, html) {
// fix backstyle
$('.flip-container .back').height($('.flip-container .front').height());
// scroll to top
$(window).scrollTop(0)
if(html)
$('.flip-container .back p').html(message);
else
$('.flip-container .back p').text(message);
// then flip that side
$('.flip-container').addClass('hover');
$('.flip-container .back button').click(function(){
$('.flip-container').removeClass('hover');
});
}
$(function() {
$('#menu li').click(function() {
flip_dialog("this is Spartaaaaaaaaaaaaaa !!!!! ");
});
$('.large-buttons').click(function() {
flip_dialog("Another Message for the greate spartians !!!!! ");
});
});
Also see: Tab Triggers