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="wrap rw-1">
<section class="panel" data-animate-scroll='{"x": "0", "y": "50", "alpha": "0","duration": "1", "delay": "1"}'>
<div id="div1" class="card-group">
<div class="card-date">JANUARY 27, 1999</div>
<h4 class="card-head">Medtronic merges with Sofamor Danek Group, which includes rights to Infuse technology</h4>
<p class="card-chatter">Infuse uses an experimental growth protein called rhBMP-2, which was being tested as a way to cause bones to fuse together after surgery. Trials on the chemical's safety and performance had just gotten underway when the merger was completed. </p>
<div class="card-ui-wrap">
<div class="card-number">1/15</div>
<a href="#"><button class="button b-left"><i class="fa fa-long-arrow-up"></i></button></a>
<a href="#div2"><button class="button b-right"><i class="fa fa-long-arrow-down"></i></button></a>
</div>
</div>
</section>
<section class="panel" data-animate-scroll='{"x": "0", "y": "50", "alpha": "0","duration": "1", "delay": "1"}'>
<div id="div2" class="card-group">
<div class="card-date">JULY 2, 2002</div>
<h4 class="card-head">The FDA approves Medtronic's Infuse to treat severe spinal disc diseases</h4>
<p class="card-chatter">Infuse worked by fusing bones in the lower spine. The approval only covered spinal-fusion surgeries performed from the front of the body, a small subset of the total spine-fusion market. The FDA approval included strict rules for long-term tracking of patients.<br> <i>Cumulative device injuries in FDA database: 1 </i></p>
<div class="card-ui-wrap">
<div class="card-number">2/15</div>
<a href="#div1"><button class="button b-left"><i class="fa fa-long-arrow-up"></i></button></a>
<a href="#div3"><button class="button b-right"><i class="fa fa-long-arrow-down"></i></button></a>
</div>
</div>
</section>
<section class="panel" data-animate-scroll='{"x": "0", "y": "50", "alpha": "0","duration": "1", "delay": "1"}'>
<div id="div3" class="card-group">
<div class="card-date">2006</div>
<h4 class="card-head">Medtronic begins study of patients treated with Infuse between 2002 and 2006</h4>
<p class="card-chatter">The study, which had formal controls, was to explore more uses for Infuse. Not all of the uses examined were off-label. Medtronic says someone at the FDA led them to believe a review of past patient charts could be used to gather data to support an application for a wider approval.<br> <i>Cumulative device injuries in FDA database: 159</i></p>
<div class="card-ui-wrap">
<div class="card-number">3/15</div>
<a href="#div2"><button class="button b-left"><i class="fa fa-long-arrow-up"></i></button></a>
<a href="#div4"><button class="button b-right"><i class="fa fa-long-arrow-down"></i></button></a>
</div>
</section>
</div>
<div class="wrap rw-2">
<section id="group-b" class="panel" data-animate-scroll='{"x": "0", "y": "50", "alpha": "0","duration": "1"}'>
<div id="div1" class="card-group">
<div class="card-date">JANUARY 27, 1999</div>
<h4 class="card-head">Medtronic merges with Sofamor Danek Group, which includes rights to Infuse technology</h4>
<p class="card-chatter">Infuse uses an experimental growth protein called rhBMP-2, which was being tested as a way to cause bones to fuse together after surgery. Trials on the chemical's safety and performance had just gotten underway when the merger was completed. </p>
<div class="card-ui-wrap">
<div class="card-number">1/15</div>
<a href="#"><button class="button b-left"><i class="fa fa-long-arrow-up"></i></button></a>
<a href="#div2"><button class="button b-right"><i class="fa fa-long-arrow-down"></i></button></a>
</div>
</div>
<div class="bottom-tear"></div>
</section>
<section class="panel" data-animate-scroll='{"x": "0", "y": "50", "alpha": "0","duration": "1"}'>
<div id="div2" class="card-group">
<div class="card-date">JULY 2, 2002</div>
<h4 class="card-head">The FDA approves Medtronic's Infuse to treat severe spinal disc diseases</h4>
<p class="card-chatter">Infuse worked by fusing bones in the lower spine. The approval only covered spinal-fusion surgeries performed from the front of the body, a small subset of the total spine-fusion market. The FDA approval included strict rules for long-term tracking of patients.<br> <i>Cumulative device injuries in FDA database: 1 </i></p>
<div class="card-ui-wrap">
<div class="card-number">2/15</div>
<a href="#div1"><button class="button b-left"><i class="fa fa-long-arrow-up"></i></button></a>
<a href="#div3"><button class="button b-right"><i class="fa fa-long-arrow-down"></i></button></a>
</div>
</div>
</section>
<section class="panel" data-animate-scroll='{"x": "0", "y": "50", "alpha": "0","duration": "1"}'>
<div id="div3" class="card-group">
<div class="card-date">2006</div>
<h4 class="card-head">Medtronic begins study of patients treated with Infuse between 2002 and 2006</h4>
<p class="card-chatter">The study, which had formal controls, was to explore more uses for Infuse. Not all of the uses examined were off-label. Medtronic says someone at the FDA led them to believe a review of past patient charts could be used to gather data to support an application for a wider approval.<br> <i>Cumulative device injuries in FDA database: 159</i></p>
<div class="card-ui-wrap">
<div class="card-number">3/15</div>
<a href="#div2"><button class="button b-left"><i class="fa fa-long-arrow-up"></i></button></a>
<a href="#div4"><button class="button b-right"><i class="fa fa-long-arrow-down"></i></button></a>
</div>
</section>
</div>
.wrap {
padding: 20px;
width: 308px;
background-color: #eeeeee;
display: inline-block;
float: left;
margin-right: 20px;
overflow: hidden;
}
.container {
height: 100vh;
}
.card-group {
width: 265px;
position: relative;
padding: 20px;
border-radius: 6px;
background-color: white;
/*-webkit-box-shadow: 0px 0px 6px 0px rgba(0,0,0,0.5);
-moz-box-shadow: 0px 0px 6px 0px rgba(0,0,0,0.5);
box-shadow: 0px 0px 6px 0px rgba(0,0,0,0.5);*/
margin-bottom: 50px;
}
.card-date {
font-size: .75em;
font-family: "Benton Sans",Helvetica,Arial,sans-serif;
margin-top: 4px;
}
.card-head h4 {
font-family: "Benton Sans Condensed Medium";
letter-spacing: -.1px;
line-height: 1.2;
color: #444;
font-weight: bold;
}
.card-chatter {
font-family: "Benton Sans", Helvetica, Arial, sans-serif;
letter-spacing: -0.1px;
font-size: 13px;
line-height: 1.4;
color: #444;
margin-top: 0px;
margin-bottom: 50px;
}
.card-ui-wrap {
position: absolute;
right: 20px;
bottom: 20px;
}
.card-number {
display: inline-block;
position: absolute;
left: -35px;
top: 0px;
padding-top: 12px;
padding-bottom: 10px;
font-family: "Benton Sans", Helvetica, Arial, sans-serif;
letter-spacing: -0.1px;
font-size: 13px;
line-height: 1.4;
color: #A9A9A9;
}
.button {
display: inline-block;
width: 40px;
height: 40px;
border-radius: 50px;
font-size:20px;
color: #000;
line-height: 50px;
text-align: center;
background: #fff;
border: 0px solid;
-webkit-box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.5);
-moz-box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.5);
box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.5);
margin-left: 5px;
cursor: pointer;
}
button:focus {
outline: 0;
}
button::-moz-focus-inner {
border: 0;
}
.fa-long-arrow-up:before {
content: "\f176";
position: absolute;
top: 12px;
margin-left: -3px;
color: #3FA9F5;
}
.fa-long-arrow-down:before {
content: ""\f175"";
position: absolute;
top: 13px;
margin-left: -3px;
color: #3FA9F5;
}
.fa {
font-size: 15px;
}
#group-b .card-group {
border-radius: 0px;
background-color: #333333;
color: #fff;
}
#group-b .button {
background-color: #FFDE00;
}
#group-b .card-head h4{
color: #FFDE00;
margin-bottom: 10px;
font-family: "Benton Sans Condensed Medium";
}
#group-b .card-chatter {
color: #fff;
}
#group-b .fa-long-arrow-up:before {
color: #333333;
}
#group-b .fa-long-arrow-down:before {
color: #333333;
}
.bottom-tear {
width: 305px;
height: 30px;
background-image: url('https://static.startribune.com/mike-test/bottom-tear.png');
margin-top: -50px;
margin-bottom: 50px;
}
//$(document).animateScroll();
//var doc = document.documentElement;
//doc.setAttribute('data-useragent', navigator.userAgent);
$(document).ready(function(){
// Add smooth scrolling to all links
$("a").on('click', function(event) {
// Prevent default anchor click behavior
event.preventDefault();
// Store hash
var hash = this.hash;
// Using jQuery's animate() method to add smooth page scroll
// The optional number (800) specifies the number of milliseconds it takes to scroll to the specified area
$('html, body').animate({
scrollTop: $(hash).offset().top
}, 800, function(){
// Add hash (#) to URL when done scrolling (default click behavior)
window.location.hash = hash;
});
});
});
Also see: Tab Triggers