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="container">
<div id="faq-links">
<div id="service" class="faq-selected">service</div>
<div id="installation">installation</div>
<div id="plan">plan</div>
<div id="features">features</div>
<div id="mobile">mobile</div>
</div>
<div id="faq-wrapper" class="about-service">
<div class="faq-group">
<div class="slide-left">
<div>service</div>
</div>
<hr>
</div><!--faq-group-->
<div class="slide-left">
<div class="faq">
<ul class="faq-accordion">
<li>
<a href="#">insane ipsum</a>
<ul class="faq-content">
<li>
<div><p>Bacon ipsum dolor sit amet ham beef ribs pork, sirloin tail meatball filet mignon pancetta strip steak. T-bone swine turducken fatback beef ribs andouille meatball. Corned beef short ribs ribeye, hamburger brisket venison capicola boudin filet mignon drumstick shankle bacon beef. Shoulder shank filet k.</p></div>
</li>
</ul>
</li>
<!--Bacon ipsum-->
<li>
<a href="#">Beer Ipsum</a>
<ul class="faq-content">
<li>
<div><p>ester saccharification mead lambic draft (draught), hand pump cask. brewing ale balthazar hops, " bitter becher craft beer keg alpha acid." crystal malt racking mouthfeel mash, barrel ale; malt! brewpub; biere de garde balthazar acid rest alcohol carbonation. wit beer krug brew mash hop back? shelf life, balthazar hand pump.</p></div>
</li>
</ul>
</li>
<!--Beer ipsum-->
<li>
<a href="#">Carey ipsum</a>
<ul class="faq-content">
<li>
<div><p>Alrighty then it's because i'm green isn't it! here she comes to wreck the day. alrighty then kinda hot in these rhinos. i just heard about evans new position,good luck to you evan backstabber, bastard, i mean baxter. your entrance was good, his was better. we're going for a ride on the information super highway. we're going for a ride on the information super highway. look at that, it's exactly three seconds before i honk your nose and pull your underwear over your head. brain freeze. we got no food we got no money and our pets heads are falling off! haaaaaaarry.</p></div>
</li>
</ul>
</li>
<!--Carey ipsum-->
</ul>
</div>
</div>
</div>
<div class="about-installation faq-hide">
<div class="faq-group">
<div class="slide-left">
<div>installation</div>
</div>
<hr>
</div>
<div class="slide-left">
<ul class="faq-accordion">
<li>
<a href="#">Bacon ipsum</a>
<ul class="faq-content">
<li>
<div><p>Bacon ipsum dolor sit amet ham beef ribs pork, sirloin tail meatball filet mignon pancetta strip steak. T-bone swine turducken fatback beef ribs andouille meatball. Corned beef short ribs ribeye, hamburger brisket venison capicola boudin filet mignon drumstick shankle bacon beef. Shoulder shank filet mignon, kevin meatball beef ribs short loin shankle kielbasa jowl pancetta. Biltong shank tri-tip prosciutto sirloin pastrami. Turkey swine pork loin ground round pig chicken kielbasa sausage kevin ham hock.</p></div>
</li>
</ul>
</li>
<!--Bacon ipsum-->
<li>
<a href="#">Beer Ipsum</a>
<ul class="faq-content">
<li>
<div><p>ester saccharification mead lambic draft (draught), hand pump cask. brewing ale balthazar hops, " bitter becher craft beer keg alpha acid." crystal malt racking mouthfeel mash, barrel ale; malt! brewpub; biere de garde balthazar acid rest alcohol carbonation. wit beer krug brew mash hop back? shelf life, balthazar hand pump.</p></div>
</li>
</ul>
</li>
<!--Beer ipsum-->
<li>
<a href="#">Carey ipsum</a>
<ul class="faq-content">
<li>
<div><p>Alrighty then it's because i'm green isn't it! here she comes to wreck the day. alrighty then kinda hot in these rhinos. i just heard about evans new position,good luck to you evan backstabber, bastard, i mean baxter. your entrance was good, his was better. we're going for a ride on the information super highway. we're going for a ride on the information super highway. look at that, it's exactly three seconds before i honk your nose and pull your underwear over your head. brain freeze. we got no food we got no money and our pets heads are falling off! haaaaaaarry.</p></div>
</li>
</ul>
</li>
<!--Carey ipsum-->
</ul>
</div><!--lide-left -->
</div>
<div class="about-plan faq-hide">
<div class="faq-group">
<div class="slide-left">
<div>plan</div>
</div>
<hr>
</div>
<div class="slide-left">
<ul class="faq-accordion">
<li>
<a href="#">Duh ipsum</a>
<ul class="faq-content">
<li>
<div><p>Bacon ipsum dolor sit amet ham beef ribs pork, sirloin tail meatball filet mignon pancetta strip steak. T-bone swine turducken fatback beef ribs andouille meatball. Corned beef short ribs ribeye, hamburger brisket venison capicola boudin filet mignon drumstick shankle bacon beef. Shoulder shank filet mignon, kevin meatball beef ribs short loin shankle kielbasa jowl pancetta. Biltong shank tri-tip prosciutto sirloin pastrami. Turkey swine pork loin ground round pig chicken kielbasa sausage kevin ham hock.</p></div>
</li>
</ul>
</li>
<!--Bacon ipsum-->
<li>
<a href="#">Buh Ipsum</a>
<ul class="faq-content">
<li>
<div><p>ester saccharification mead lambic draft (draught), hand pump cask. brewing ale balthazar hops, " bitter becher craft beer keg alpha acid." crystal malt racking mouthfeel mash, barrel ale; malt! brewpub; biere de garde balthazar acid rest alcohol carbonation. wit beer krug brew mash hop back? shelf life, balthazar hand pump.</p></div>
</li>
</ul>
</li>
<!--Beer ipsum-->
<li>
<a href="#">Muh ipsum</a>
<ul class="faq-content">
<li>
<div><p>Alrighty then it's because i'm green isn't it! here she comes to wreck the day. alrighty then kinda hot in these rhinos. i just heard about evans new position,good luck to you evan backstabber, bastard, i mean baxter. your entrance was good, his was better. we're going for a ride on the information super highway. we're going for a ride on the information super highway. look at that, it's exactly three seconds before i honk your nose and pull your underwear over your head. brain freeze. we got no food we got no money and our pets heads are falling off! haaaaaaarry.</p></div>
</li>
</ul>
</li>
<!--Carey ipsum-->
</ul>
</div><!--slide-left-->
</div>
<div class="about-features faq-hide">
<div class="faq-group">
<div class="slide-left">
<div>features</div>
</div>
<hr>
</div>
<div class="slide-left">
<ul class="faq-accordion">
<li>
<a href="#">Veggie ipsum</a>
<ul class="faq-content">
<li>
<div><p>Bacon ipsum dolor sit amet ham beef ribs pork, sirloin tail meatball filet mignon pancetta strip steak. T-bone swine turducken fatback beef ribs andouille meatball. Corned beef short ribs ribeye, hamburger brisket venison capicola boudin filet mignon drumstick shankle bacon beef. Shoulder shank filet mignon, kevin meatball beef ribs short loin shankle kielbasa jowl pancetta. Biltong shank tri-tip prosciutto sirloin pastrami. Turkey swine pork loin ground round pig chicken kielbasa sausage kevin ham hock.</p></div>
</li>
</ul>
</li>
<!--Bacon ipsum-->
<li>
<a href="#">Wine Ipsum</a>
<ul class="faq-content">
<li>
<div><p>ester saccharification mead lambic draft (draught), hand pump cask. brewing ale balthazar hops, " bitter becher craft beer keg alpha acid." crystal malt racking mouthfeel mash, barrel ale; malt! brewpub; biere de garde balthazar acid rest alcohol carbonation. wit beer krug brew mash hop back? shelf life, balthazar hand pump.</p></div>
</li>
</ul>
</li>
<!--Beer ipsum-->
<li>
<a href="#">Woody ipsum</a>
<ul class="faq-content">
<li>
<div><p>Alrighty then it's because i'm green isn't it! here she comes to wreck the day. alrighty then kinda hot in these rhinos. i just heard about evans new position,good luck to you evan backstabber, bastard, i mean baxter. your entrance was good, his was better. we're going for a ride on the information super highway. we're going for a ride on the information super highway. look at that, it's exactly three seconds before i honk your nose and pull your underwear over your head. brain freeze. we got no food we got no money and our pets heads are falling off! haaaaaaarry.</p></div>
</li>
</ul>
</li>
</ul>
</div><!--slide-left-->
</div> <!--about-features faq-hide-->
<div class="about-mobile faq-hide">
<div class="faq-group">
<div class="slide-left">
<div>mobile</div>
</div>
<hr>
</div>
<div class="slide-left">
<ul class="faq-accordion">
<li>
<a href="#">Bacon ipsum</a>
<ul class="faq-content">
<li>
<div><p>Bacon ipsum dolor sit amet ham beef ribs pork, sirloin tail meatball filet mignon pancetta strip steak. T-bone swine turducken fatback beef ribs andouille meatball. Corned beef short ribs ribeye, hamburger brisket venison capicola boudin filet mignon drumstick shankle bacon beef. Shoulder shank filet mignon, kevin meatball beef ribs short loin shankle kielbasa jowl pancetta. Biltong shank tri-tip prosciutto sirloin pastrami. Turkey swine pork loin ground round pig chicken kielbasa sausage kevin ham hock.</p></div>
</li>
</ul>
</li>
<!--Bacon ipsum-->
<li>
<a href="#">Beer Ipsum</a>
<ul class="faq-content">
<li>
<div><p>ester saccharification mead lambic draft (draught), hand pump cask. brewing ale balthazar hops, " bitter becher craft beer keg alpha acid." crystal malt racking mouthfeel mash, barrel ale; malt! brewpub; biere de garde balthazar acid rest alcohol carbonation. wit beer krug brew mash hop back? shelf life, balthazar hand pump.</p></div>
</li>
</ul>
</li>
<!--Beer ipsum-->
<li>
<a href="#">Carey ipsum</a>
<ul class="faq-content">
<li>
<div><p>Alrighty then it's because i'm green isn't it! here she comes to wreck the day. alrighty then kinda hot in these rhinos. i just heard about evans new position,good luck to you evan backstabber, bastard, i mean baxter. your entrance was good, his was better. we're going for a ride on the information super highway. we're going for a ride on the information super highway. look at that, it's exactly three seconds before i honk your nose and pull your underwear over your head. brain freeze. we got no food we got no money and our pets heads are falling off! haaaaaaarry.</p></div>
</li>
</ul>
</li>
<!--Carey ipsum-->
</ul>
</div><!--slide-left-->
</div> <!--about-mobile faq-hide-->
</div><!--container-->
body {font-family: helvetica}
.container {width: 320px; margin: 0 auto; overflow: hidden}
a{text-decoration: none}
#faq-links {padding: 10px 20px}
#faq-links div {
color: #aeaeaf;
cursor: pointer;
font-weight: 700;
text-transform: capitalize;
margin: 18px 0
}
.faq-group {
padding: 0 20px 40px 20px;
position: relative
}
.faq-group div {
font-weight: 700;
text-align: center;
}
.faq-group hr {
border: 0;
border-top: 1px solid #606060;
clear: both;
-moz-box-sizing: content-box;
-webkit-box-sizing: content-box;
box-sizing: content-box;
height: 0;
}
.faq-group:after {
top: 33%;
left: 50%;
border: solid transparent;
content: " ";
height: 0;
width: 0;
position: absolute;
pointer-events: none;
border-top-color: #393939;
border-width: 15px;
margin-left: -15px
}
.faq-accordion>li {
border-top: 1px solid rgba(198, 198, 198, 0.4);
color: #666;
padding: 1.125em 0
}
.faq-accordion li a {
color: #666;
padding: 1.125em;
}
.faq-accordion > li:last-child {
border-bottom: 1px solid rgba(198, 198, 198, 0.4);
}
.faq-accordion > li > a:before {
content: 'Q.';
padding-right: 0.313em
}
.faq-accordion > li > a:after {
color: #ff8300;
content: '+';
float: right;
font-weight:300;
margin-right: 1.25em;
-webkit-transform: scale(2);
-ms-transform: scale(2);
transform: scale(2);
overflow-y: hidden;
}
.faq-accordion > li > a.expanded:after {
color: #ffa326;
content: '\2212';
-webkit-transform: scale(2);
-ms-transform: scale(2);
transform: scale(2);
}
.faq-accordion > li > a.expanded {font-weight: 700; opacity: 1 !important}
.faq-content {
background-color: #ececec;
margin: 20px 0 -20px;
}
.faq-content p:before {
content: 'A.';
color: #ff8300;
float: left;
font-weight: 700;
margin-right: .5em
}
.faq-content p {
margin: 0 1.2em;
padding: 1.250em 0
}
.faq-hide {display: none}
.faq-selected {
color: #49494b!important;
-webkit-transition: all 1s ease;
transition: all 1s ease;
}
.slide-left{
-webkit-animation-name: slide-left;
-moz-animation-name: slide-left;
animation-name: slide-left;
-webkit-animation-duration: 1s;
-moz-animation-duration: 1s;
animation-duration: 1s;
-webkit-animation-timing-function: ease-in-out;
-moz-animation-timing-function: ease-in-out;
animation-timing-function: ease-in-out;
}
@-webkit-keyframes slide-left {
0% {
-webkit-transform: translateX(150%);
}
50%{
-webkit-transform: translateX(-8%);
}
65%{
-webkit-transform: translateX(4%);
}
80%{
-webkit-transform: translateX(-4%);
}
95%{
-webkit-transform: translateX(2%);
}
100% {
-webkit-transform: translateX(0%);
}
}
@-moz-keyframes slide-left {
0% {
-webkit-transform: translateX(150%);
-moz-transform: translateX(150%);
transform: translateX(150%);
}
50%{
-webkit-transform: translateX(-8%);
-moz-transform: translateX(-8%);
transform: translateX(-8%);
}
65%{
-webkit-transform: translateX(4%);
-moz-transform: translateX(4%);
transform: translateX(4%);
}
80%{
-webkit-transform: translateX(-4%);
-moz-transform: translateX(-4%);
transform: translateX(-4%);
}
95%{
-webkit-transform: translateX(2%);
-moz-transform: translateX(2%);
transform: translateX(2%);
}
100% {
-webkit-transform: translateX(0%);
-moz-transform: translateX(0%);
transform: translateX(0%);
}
}
@keyframes slide-left {
0% {
-webkit-transform: translateX(150%);
-moz-transform: translateX(150%);
transform: translateX(150%);
}
50%{
-webkit-transform: translateX(-8%);
-moz-transform: translateX(-8%);
transform: translateX(-8%);
}
65%{
-webkit-transform: translateX(4%);
-moz-transform: translateX(4%);
transform: translateX(4%);
}
80%{
-webkit-transform: translateX(-4%);
-moz-transform: translateX(-4%);
transform: translateX(-4%);
}
95%{
-webkit-transform: translateX(2%);
-moz-transform: translateX(2%);
transform: translateX(2%);
}
100% {
-webkit-transform: translateX(0%);
-moz-transform: translateX(0%);
transform: translateX(0%);
}
}
/*<p>Pagination part? borrowed from <a href='/JoshBlackwood/'>Joshua Blackwood</a>'s Pen <a href='/JoshBlackwood/pen/yoLBJ/'>yoLBJ</a>.</p>*/
var accordWithPage = function() {
var faqDiv = $('#faq-links div');
$(function () {
faqDiv.click(function() {
var hideSec = 'faq-hide';
var $this = $(this),
$id = $this.attr('id'),
$class = '.' + $('.about-' + $id).attr('class').replace(hideSec, '');
$('#faq-wrapper').addClass(hideSec);
$('.about-' + $id).removeClass(hideSec);
$('div[class*=about]').not($class).addClass(hideSec);
});
});
$(function () {
var select = 'faq-selected';
faqDiv.click(function () {
if ($(this).hasClass(select)) {
$(this).removeClass(select);
} else {
$('#faq-links .faq-selected').removeClass(select);
$(this).addClass(select);
}
}); //faq link selected
});
//Accordion
$(function () {
var expand = 'expanded';
var content = $('.faq-content');
//FAQ Accordion
$('.faq-accordion > li > a').click(function (e) {
e.preventDefault();
if ($(this).hasClass(expand)) {
$(this).removeClass(expand);
// $('.faq-accordion > li > a > div').not(this).css('opacity', '1');//returns li back to normal state
$(this).parent().children('ul').stop(true, true).slideUp();
} else {
// $('.faq-accordion > li > a > div').not(this).css('opacity', '0.5');//dims inactive li
$('.faq-accordion > li > a.expanded').removeClass(expand);
$(this).addClass(expand);
content.filter(":visible").slideUp();
$(this).parent().children('ul').stop(true, true).slideDown();
}
}); //accordion function
content.hide();
});
}
accordWithPage();
/*$(function () {
$("#faq-links div").click(function () {
$('.slide-left').fadeOut( "slow", "linear" );
$('.slide-left').fadeIn( "slow", "linear" );
}); //faq link fade in and out
}); //document ready*/
Also see: Tab Triggers