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.
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Client Testimonials Carousel</title>
<script type="text/javascript" src="https://fast.fonts.net/jsapi/33e424f6-3f70-4c68-93b2-29f9f67b2b87.js"></script>
</head>
<div class="cd-testimonials-wrapper cd-container">
<ul class="cd-testimonials">
<li>
<p>I’ve made several purchases from Tamarkin including a minty Leicameter. Each time, I’ve been treated like an old friend. No matter if I call or email, no matter how busy the shop is, they are patient, helpful and appreciative of my business. I also would have fumbled around forever learning to load film into an M camera if it weren’t for Dan’s great “how to Leica” videos on You Tube.</p>
<div class="cd-author">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/3393/leicame.jpg" alt="Author image">
<ul class="cd-author-info">
<li>John Smith</li>
</ul>
</div>
</li>
<li>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Necessitatibus ea, perferendis error repudiandae numquam dolor fuga temporibus. Unde omnis, consequuntur.</p>
<div class="cd-author">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/3393/avatar-2.jpg" alt="Author image">
<ul class="cd-author-info">
<li>MyName</li>
</ul>
</div>
</li>
<li>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quam totam nulla est, illo molestiae maxime officiis, quae ad, ipsum vitae deserunt molestias eius alias.</p>
<div class="cd-author">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/3393/avatar-3.jpg" alt="Author image">
<ul class="cd-author-info">
<li>MyName</li>
</ul>
</div>
</li>
</ul> <!-- cd-testimonials -->
<a href="#0" class="cd-see-all">See all</a>
</div> <!-- cd-testimonials-wrapper -->
<div class="cd-testimonials-wrapper cd-container">
<ul class="cd-testimonials">
<li>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
<div class="cd-author">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/3393/avatar-1.jpg" alt="Author image">
<ul class="cd-author-info">
<li>MyName</li>
</ul>
</div>
</li>
<li>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Necessitatibus ea, perferendis error repudiandae numquam dolor fuga temporibus. Unde omnis, consequuntur.</p>
<div class="cd-author">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/3393/avatar-2.jpg" alt="Author image">
<ul class="cd-author-info">
<li>MyName</li>
</ul>
</div>
</li>
<li>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quam totam nulla est, illo molestiae maxime officiis, quae ad, ipsum vitae deserunt molestias eius alias.</p>
<div class="cd-author">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/3393/avatar-3.jpg" alt="Author image">
<ul class="cd-author-info">
<li>MyName</li>
</ul>
</div>
</li>
</ul> <!-- cd-testimonials -->
<a href="#0" class="cd-see-all">See all</a>
</div> <!-- cd-testimonials-wrapper -->
<div class="cd-testimonials-all">
<div class="cd-testimonials-all-wrapper">
<ul>
<li class="cd-testimonials-item">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Odit totam saepe iste maiores neque animi molestias nihil illum nisi temporibus.</p>
<div class="cd-author">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/3393/avatar-1.jpg" alt="Author image">
<ul class="cd-author-info">
<li>MyName</li>
</ul>
</div> <!-- cd-author -->
</li>
<li class="cd-testimonials-item">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Labore nostrum nisi, doloremque error hic nam nemo doloribus porro impedit perferendis. Tempora, distinctio hic suscipit. At ullam eaque atque recusandae modi fugiat voluptatem laborum laboriosam rerum, consequatur reprehenderit omnis, enim pariatur nam, quidem, quas vel reiciendis aspernatur consequuntur. Commodi quasi enim, nisi alias fugit architecto, doloremque, eligendi quam autem exercitationem consectetur.</p>
<div class="cd-author">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/3393/avatar-2.jpg" alt="Author image">
<ul class="cd-author-info">
<li>MyName</li>
</ul>
</div> <!-- cd-author -->
</li>
<li class="cd-testimonials-item">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Exercitationem quibusdam eveniet, molestiae laborum voluptatibus minima hic quasi accusamus ut facere, eius expedita, voluptatem? Repellat incidunt veniam quaerat, qui laboriosam dicta. Quidem ducimus laudantium dolorum enim qui at ipsum, a error.</p>
<div class="cd-author">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/3393/avatar-3.jpg" alt="Author image">
<ul class="cd-author-info">
<li>MyName</li>
</ul>
</div> <!-- cd-author -->
</li>
<li class="cd-testimonials-item">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Libero voluptates officiis tempore quae officia! Beatae quia deleniti cum corporis eos perferendis libero reiciendis nemo iusto accusamus, debitis tempora voluptas praesentium repudiandae laboriosam excepturi laborum, nisi optio repellat explicabo, incidunt ex numquam. Ullam perferendis officiis harum doloribus quae corrupti minima quia, aliquam nostrum expedita pariatur maxime repellat, voluptas sunt unde, inventore.</p>
<div class="cd-author">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/3393/avatar-4.jpg" alt="Author image">
<ul class="cd-author-info">
<li>MyName</li>
</ul>
</div> <!-- cd-author -->
</li>
<li class="cd-testimonials-item">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Odit totam saepe iste maiores neque animi molestias nihil illum nisi temporibus.</p>
<div class="cd-author">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/3393/avatar-5.jpg" alt="Author image">
<ul class="cd-author-info">
<li>MyName</li>
</ul>
</div> <!-- cd-author -->
</li>
<li class="cd-testimonials-item">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Perspiciatis quia quas, quis illo adipisci voluptate ex harum iste commodi nulla dolor. Eius ratione quod ab!</p>
<div class="cd-author">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/3393/avatar-6.jpg" alt="Author image">
<ul class="cd-author-info">
<li>MyName</li>
</ul>
</div> <!-- cd-author -->
</li>
</ul>
</div> <!-- cd-testimonials-all-wrapper -->
<a href="#0" class="close-btn">Close</a>
</div> <!-- cd-testimonials-all -->
<script src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/3393/jquery-2.1.1.js"></script>
<script src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/3393/masonry.pkgd.min.js"></script>
<script src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/3393/jquery.flexslider-min.js"></script>
<script src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/3393/main.js"></script>
@import "compass/css3";
/* --------------------------------
Primary style
-------------------------------- */
*, *:after, *:before {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
body {
background: #fff;
color: #515151;
font-size: 100%;
font-family: "Corporate S W01";
}
a {
color: #79b6e4;
text-decoration: none;
}
img {
max-width: 100%;
}
/* --------------------------------
Main components
-------------------------------- */
.cd-testimonials-wrapper {
position: relative;
width: 90%;
max-width: 768px;
background-color: #de373f;
margin: 2em auto;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
padding: 20px 40px 70px;
z-index: 1;
}
.cd-testimonials-wrapper:first-of-type {
background-color: #e30613;
background-color: #7c7171;
}
.cd-testimonials-wrapper::after {
/* quotation mark */
content: '\201C';
position: absolute;
top: 10px;
left: 0;
width: 50px;
height: 50px;
padding-top: 8px;
margin-left: -25px;
background: rgba(32, 32, 34, 0.9);
background: #e30613;
font-family: "Georgia", serif;
color: white;
font-size: 70px;
font-size: 4.375rem;
text-align: center;
/* visible on big devices only */
display: none;
}
@media only screen and (min-width: 768px) {
.cd-testimonials-wrapper {
margin: 4em auto;
padding: 64px 50px 114px;
}
}
@media only screen and (min-width: 1170px) {
.cd-testimonials-wrapper::after {
/* quotation mark visible */
display: block;
}
}
.cd-testimonials {
color: white;
text-align: center;
}
.cd-testimonials:after {
content: "";
display: table;
clear: both;
}
.cd-testimonials > li {
position: absolute;
opacity: 0;
}
.cd-testimonials > li:first-child {
position: relative;
opacity: 1;
}
.cd-testimonials p {
font-family:'Adobe Garamond W01',serif;
font-style: italic;
line-height: 1.4;
margin-bottom: 1em;
padding: 0 14px;
font-weight: 400;
}
@media only screen and (min-width: 768px) {
.cd-testimonials p {
font-size: 22px;
font-size: 1.375rem;
}
}
@media only screen and (min-width: 1170px) {
.cd-testimonials p {
font-size: 26px;
font-size: 1.625rem;
line-height: 1.6;
}
}
.cd-author img, .cd-author .cd-author-info {
display: inline-block;
vertical-align: middle;
}
.cd-author img {
width: 48px;
height: 48px;
border-radius: 50%;
margin-right: 5px;
box-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
}
.cd-author .cd-author-info {
text-align: left;
line-height: 1.2;
}
.cd-author .cd-author-info li:first-child {
font-size: 14px;
font-size: 0.875rem;
}
.cd-author .cd-author-info li:last-child {
font-size: 12px;
font-size: 0.75rem;
color: #fff;
}
@media only screen and (min-width: 768px) {
.cd-author img {
width: 50px;
height: 50px;
}
.cd-author .cd-author-info {
line-height: 1.4;
}
.cd-author .cd-author-info li:first-child {
font-size: 16px;
font-size: 1rem;
}
.cd-author .cd-author-info li:last-child {
font-size: 14px;
font-size: 0.875rem;
}
}
.flex-direction-nav li {
position: absolute;
height: 100%;
width: 40px;
top: 0;
}
.flex-direction-nav li:first-child {
left: 0;
}
.flex-direction-nav li:last-child {
right: 0;
}
.flex-direction-nav li a {
display: block;
height: 100%;
width: 100%;
/* image replacement */
overflow: hidden;
text-indent: 100%;
white-space: nowrap;
-webkit-transition: background-color 0.2s;
-moz-transition: background-color 0.2s;
transition: background-color 0.2s;
}
.no-touch .flex-direction-nav li a:hover {
background-color: rgba(37,37,37,0.1);
}
.flex-direction-nav li a::before, .flex-direction-nav li a::after {
/* left and right arrows in css only */
content: '';
position: absolute;
left: 50%;
top: 50%;
width: 2px;
height: 13px;
background-color: white;
}
.flex-direction-nav li a::before {
-webkit-transform: translateY(-35px) rotate(45deg);
-moz-transform: translateY(-35px) rotate(45deg);
-ms-transform: translateY(-35px) rotate(45deg);
-o-transform: translateY(-35px) rotate(45deg);
transform: translateY(-35px) rotate(45deg);
}
.flex-direction-nav li a::after {
-webkit-transform: translateY(-27px) rotate(-45deg);
-moz-transform: translateY(-27px) rotate(-45deg);
-ms-transform: translateY(-27px) rotate(-45deg);
-o-transform: translateY(-27px) rotate(-45deg);
transform: translateY(-27px) rotate(-45deg);
}
.flex-direction-nav li:last-child a::before {
-webkit-transform: translateY(-35px) rotate(-45deg);
-moz-transform: translateY(-35px) rotate(-45deg);
-ms-transform: translateY(-35px) rotate(-45deg);
-o-transform: translateY(-35px) rotate(-45deg);
transform: translateY(-35px) rotate(-45deg);
}
.flex-direction-nav li:last-child a::after {
-webkit-transform: translateY(-27px) rotate(45deg);
-moz-transform: translateY(-27px) rotate(45deg);
-ms-transform: translateY(-27px) rotate(45deg);
-o-transform: translateY(-27px) rotate(45deg);
transform: translateY(-27px) rotate(45deg);
}
@media only screen and (min-width: 768px) {
.flex-direction-nav li {
width: 50px;
}
}
@media only screen and (min-width: 1170px) {
.flex-direction-nav li a::before, .flex-direction-nav li a::after {
/* background-color: #5e5e63; */
-webkit-transition: background-color 0.2s;
-moz-transition: background-color 0.2s;
transition: background-color 0.2s;
}
.flex-direction-nav li a:hover::before, .flex-direction-nav li a:hover::after {
background-color: white;
}
}
.cd-see-all {
position: absolute;
z-index: 1;
left: 0;
bottom: 0;
width: 100%;
height: 50px;
line-height: 50px;
background-color: rgba(37, 37, 37, 0.2);
text-align: center;
text-transform: uppercase;
color: #fff;
font-weight: 700;
font-size: 12px;
font-size: 0.75rem;
-webkit-transition: color, 0.2s;
-moz-transition: color, 0.2s;
transition: color, 0.2s;
}
.cd-testimonials-all {
position: fixed;
top: 0;
left: 0;
height: 100%;
width: 100%;
background-color: white;
z-index: 2;
visibility: hidden;
opacity: 0;
-webkit-transition: opacity .3s 0s, visibility 0s .3s;
-moz-transition: opacity .3s 0s, visibility 0s .3s;
transition: opacity .3s 0s, visibility 0s .3s;
}
.cd-testimonials-all .cd-testimonials-all-wrapper {
position: absolute;
left: 0;
top: 0;
height: 100%;
width: 100%;
overflow: auto;
-webkit-overflow-scrolling: touch;
}
.cd-testimonials-all .cd-testimonials-all-wrapper > ul {
width: 90%;
max-width: 1170px;
margin: 4em auto;
}
.cd-testimonials-all .cd-testimonials-all-wrapper > ul:after {
content: "";
display: table;
clear: both;
}
.cd-testimonials-all .cd-testimonials-item {
margin-bottom: 2em;
opacity: 0;
/* Force Hardware Acceleration in WebKit */
-webkit-transform: translate3d(0, 0, 0) scale(0.4);
-moz-transform: translate3d(0, 0, 0) scale(0.4);
-ms-transform: translate3d(0, 0, 0) scale(0.4);
-o-transform: translate3d(0, 0, 0) scale(0.4);
transform: translate3d(0, 0, 0) scale(0.4);
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
-webkit-transition: -webkit-transform .3s, opacity .3s;
-moz-transition: -moz-transform .3s, opacity .3s;
transition: transform .3s, opacity .3s;
}
.cd-testimonials-all p {
position: relative;
background: rgba(37,37,37,0.7);
color: white;
padding: 2em;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
line-height: 1.4;
border-radius: 0.25em;
margin-bottom: 1em;
}
.cd-testimonials-all p::after {
/* creating the triangle in css */
content: '';
position: absolute;
top: 100%;
left: 2em;
height: 0;
width: 0;
border: 8px solid transparent;
border-top-color: rgba(37,37,37,0.7);
}
.cd-testimonials-all .cd-author {
text-align: left;
margin-left: 1.5em;
}
.cd-testimonials-all .cd-author img {
box-shadow: 0 0 0 transparent;
}
.cd-testimonials-all.is-visible {
visibility: visible;
opacity: 1;
-webkit-transition: opacity .3s 0s, visibility 0s 0s;
-moz-transition: opacity .3s 0s, visibility 0s 0s;
transition: opacity .3s 0s, visibility 0s 0s;
}
.cd-testimonials-all.is-visible .cd-testimonials-item {
opacity: 1;
-webkit-transform: translate3d(0, 0, 0) scale(1);
-moz-transform: translate3d(0, 0, 0) scale(1);
-ms-transform: translate3d(0, 0, 0) scale(1);
-o-transform: translate3d(0, 0, 0) scale(1);
transform: translate3d(0, 0, 0) scale(1);
}
@media only screen and (min-width: 768px) {
.cd-testimonials-all .cd-testimonials-item {
width: 46%;
margin: 0 2% 3em;
}
.cd-testimonials-all .cd-author {
margin-left: 1em;
}
}
@media only screen and (min-width: 1170px) {
.cd-testimonials-all .cd-testimonials-item {
width: 30%;
margin: 0 1.6666% 3em;
}
}
.close-btn {
position: fixed;
display: block;
width: 40px;
height: 40px;
top: 10px;
right: 5%;
/* image replacement */
overflow: hidden;
text-indent: 100%;
white-space: nowrap;
}
.close-btn::before, .close-btn::after {
/* close icon in css */
content: '';
position: absolute;
display: inline-block;
width: 2px;
height: 24px;
top: 8px;
left: 19px;
background-color: #39393c;
}
.close-btn::before {
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
}
.close-btn::after {
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
-ms-transform: rotate(-45deg);
-o-transform: rotate(-45deg);
transform: rotate(-45deg);
}
Also see: Tab Triggers