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 id="container-fluid">
<div class="row come-in">
<h1 class="text-center">Responsive Bootstrap Card-UI with Animation</h1>
<div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
<div class="panel panel-primary">
<div class="panel-heading">Jules Verne - Around the World in 80 Days</div>
<div class="panel-body">
<p>"Sir," said Mr. Fogg to the captain, "three passengers have disappeared."</p>
<p>"Dead?" asked the captain.</p>
<p>"Dead or prisoners; that is the uncertainty which must be solved. Do you propose to pursue the Sioux?"</p>
<p>"That's a serious thing to do, sir," returned the captain. "These Indians may retreat beyond the Arkansas, and I cannot leave the fort unprotected."</p>
<p>"The lives of three men are in question, sir," said Phileas Fogg.</p>
</div>
</div>
<div class="panel panel-default fadeInDown">
<div class="panel-body">
<p>"Doubtless; but can I risk the lives of fifty men to save three?"</p>
<p>"I don't know whether you can, sir; but you ought to do so."</p>
<p>"Nobody here," returned the other, "has a right to teach me my duty."</p>
<p>"Very well," said Mr. Fogg, coldly. "I will go alone."</p>
<p>"You, sir!" cried Fix, coming up; "you go alone in pursuit of the Indians?"</p>
</div>
</div>
</div>
<div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
<div class="panel panel-info">
<div class="panel-heading">H.G. Wells - The War of the Worlds</div>
<div class="panel-body">
<p>By midnight the blazing trees along the slopes of Richmond Park and the glare of Kingston Hill threw their light upon a network of black smoke, blotting out the whole valley of the Thames and extending as far as the eye could reach. And through this two Martians slowly waded, and turned their hissing steam jets this way and that.</p>
<p>They were sparing of the Heat-Ray that night, either because they had but a limited supply of material for its production or because they did not wish to destroy the country but only to crush and overawe the opposition they had aroused. In the latter aim they certainly succeeded. Sunday night was the end of the organised opposition to their movements. After that no body of men would stand against them, so hopeless was the enterprise. Even the crews of the torpedo-boats and destroyers that had brought their quick-firers up the Thames refused to stop, mutinied, and went down again. The only offensive operation men ventured upon after that night was the preparation of mines and pitfalls, and even in that their energies were frantic and spasmodic.</p>
<p>One has to imagine, as well as one may, the fate of those batteries towards Esher, waiting so tensely in the twilight. Survivors there were none. One may picture the orderly expectation, the officers alert and watchful, the gunners ready, the ammunition piled to hand, the limber gunners with their horses and waggons, the groups of civilian spectators standing as near as they were permitted, the evening stillness, the ambulances and hospital tents with the burned and wounded from Weybridge; then the dull resonance of the shots the Martians fired, and the clumsy projectile whirling over the trees and houses and smashing amid the neighbouring fields.</p>
<p>One may picture, too, the sudden shifting of the attention, the swiftly spreading coils and bellyings of that blackness advancing headlong, towering heavenward, turning the twilight to a palpable darkness, a strange and horrible antagonist of vapour striding upon its victims, men and horses near it seen dimly, running, shrieking, falling headlong, shouts of dismay, the guns suddenly abandoned, men choking and writhing on the ground, and the swift broadening-out of the opaque cone of smoke. And then night and extinction--nothing but a silent mass of impenetrable vapour hiding its dead.</p>
<p>Before dawn the black vapour was pouring through the streets of Richmond, and the disintegrating organism of government was, with a last expiring effort, rousing the population of London to the necessity of flight.</p>
</div>
</div>
<div class="panel panel-default">
<div class="panel-body">
<p>Before dawn the black vapour was pouring through the streets of Richmond, and the disintegrating organism of government was, with a last expiring effort, rousing the population of London to the necessity of flight.</p>
<p>So you understand the roaring wave of fear that swept through the greatest city in the world just as Monday was dawning--the stream of flight rising swiftly to a torrent, lashing in a foaming tumult round the railway stations, banked up into a horrible struggle about the shipping in the Thames, and hurrying by every available channel northward and eastward. By ten o'clock the police organisation, and by midday even the railway organisations, were losing coherency, losing shape and efficiency, guttering, softening, running at last in that swift liquefaction of the social body.</p>
<p>All the railway lines north of the Thames and the South-Eastern people at Cannon Street had been warned by midnight on Sunday, and trains were being filled. People were fighting savagely for standing-room in the carriages even at two o'clock. By three, people were being trampled and crushed even in Bishopsgate Street, a couple of hundred yards or more from Liverpool Street station; revolvers were fired, people stabbed, and the policemen who had been sent to direct the traffic, exhausted and infuriated, were breaking the heads of the people they were called out to protect.</p>
<p>And as the day advanced and the engine drivers and stokers refused to return to London, the pressure of the flight drove the people in an ever-thickening multitude away from the stations and along the northward-running roads. By midday a Martian had been seen at Barnes, and a cloud of slowly sinking black vapour drove along the Thames and across the flats of Lambeth, cutting off all escape over the bridges in its sluggish advance. Another bank drove over Ealing, and surrounded a little island of survivors on Castle Hill, alive, but unable to escape.</p>
<p></p>
<p>So he got out of the fury of the panic, and, skirting the Edgware Road, reached Edgware about seven, fasting and wearied, but well ahead of the crowd. Along the road people were standing in the roadway, curious, wondering. He was passed by a number of cyclists, some horsemen, and two motor cars. A mile from Edgware the rim of the wheel broke, and the machine became unridable. He left it by the roadside and trudged through the village. There were shops half opened in the main street of the place, and people crowded on the pavement and in the doorways and windows, staring astonished at this extraordinary procession of fugitives that was beginning. He succeeded in getting some food at an inn.</p>
</div>
</div>
</div>
<div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
<div class="panel panel-warning">
<div class="panel-heading">L. Frank Baum - The Wizard of Oz</div>
<div class="panel-body">
<p>"Don't speak of it, I beg of you," replied the Woodman. "I have no heart, you know, so I am careful to help all those who may need a friend, even if it happens to be only a mouse."</p>
<p>"Only a mouse!" cried the little animal, indignantly. "Why, I am a Queen--the Queen of all the Field Mice!"</p>
<p>"Oh, indeed," said the Woodman, making a bow.</p>
<p>"Therefore you have done a great deed, as well as a brave one, in saving my life," added the Queen.</p>
<p>At that moment several mice were seen running up as fast as their little legs could carry them, and when they saw their Queen they exclaimed:</p>
</div>
</div>
<div class="panel panel-default">
<div class="panel-body">
<p>"Oh, your Majesty, we thought you would be killed! How did you manage to escape the great Wildcat?" They all bowed so low to the little Queen that they almost stood upon their heads.</p>
<p>"This funny tin man," she answered, "killed the Wildcat and saved my life. So hereafter you must all serve him, and obey his slightest wish."</p>
<p>"We will!" cried all the mice, in a shrill chorus. And then they scampered in all directions, for Toto had awakened from his sleep, and seeing all these mice around him he gave one bark of delight and jumped right into the middle of the group. Toto had always loved to chase mice when he lived in Kansas, and he saw no harm in it.</p>
<p>But the Tin Woodman caught the dog in his arms and held him tight, while he called to the mice, "Come back! Come back! Toto shall not hurt you."</p>
<p>At this the Queen of the Mice stuck her head out from underneath a clump of grass and asked, in a timid voice, "Are you sure he will not bite us?"</p>
</div>
</div>
</div>
</div>
</div>
body {
padding: 50px;
line-height: 150%;
}
/* Add Styles for your cards here */
/* ------ */
/* Animation SCSS */
.come-in {
-webkit-transform: translateY(150px);
-ms-transform: translateY(150px);
transform: translateY(150px);
-webkit-animation: come-in 0.8s ease forwards;
animation: come-in 0.8s ease forwards;
}
.come-in:nth-child(odd) {
-webkit-animation-duration: 0.6s;
animation-duration: 0.6s;
}
.already-visible {
-webkit-transform: translateY(0);
-ms-transform: translateY(0);
transform: translateY(0);
-webkit-animation: none;
animation: none;
}
@-webkit-keyframes come-in {
to {
-webkit-transform: translateY(0);
transform: translateY(0);
}
}
@keyframes come-in {
to {
-webkit-transform: translateY(0);
transform: translateY(0);
}
}
(function($) {
/**
* Copyright 2012, Digital Fusion
* Licensed under the MIT license.
* http://teamdf.com/jquery-plugins/license/
*
* @author Sam Sehnert
* @desc A small plugin that checks whether elements are within
* the user visible viewport of a web browser.
* only accounts for vertical position, not horizontal.
*/
$.fn.visible = function(partial) {
var $t = $(this),
$w = $(window),
viewTop = $w.scrollTop(),
viewBottom = viewTop + $w.height(),
_top = $t.offset().top,
_bottom = _top + $t.height(),
compareTop = partial === true ? _bottom : _top,
compareBottom = partial === true ? _top : _bottom;
return ((compareBottom <= viewBottom) && (compareTop >= viewTop));
};
})(jQuery);
var win = $(window);
var allMods = $(".panel");
allMods.each(function(i, el) {
var el = $(el);
if (el.visible(true)) {
el.addClass("already-visible");
}
});
win.scroll(function(event) {
allMods.each(function(i, el) {
var el = $(el);
if (el.visible(true)) {
el.addClass("come-in");
}
});
});
Also see: Tab Triggers