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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.
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.
If the stylesheet 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 CSS 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.
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="section style1">
<div class="container">
<div class="col-xs-12 col-sm-6">
<div class="box">
“It’s not easy to achieve what I’ve done, but my view is that when you have a dream and you really pursue it and picture things like this happening, then it can become a reality”
</div>
<div class="name">
James Rodriguez
</div>
</div><!-- /col-sm-6 -->
<div class="col-xs-12 col-sm-6">
<div class="box2">
"I've spent two years in their football culture and it makes you change. I'm more mature as a person and a player. I'm a very different person from when I arrived in England"
</div>
<div class="name">
David De Gea
</div>
</div>
</div>
</div>
<div class="section style2">
<div class="container">
<div class="col-xs-12">
<div class="box">
"Money is not a motivating factor. Money doesn't thrill me or make me play better because there are benefits to being wealthy. I'm just happy with a ball at my feet. My motivation comes from playing the game I love. If I wasn't paid to be a professional footballer I would willingly play for nothing."
<div class="name">
Lionel Messi
</div>
</div>
</div>
</div>
</div>
<div class="section style3">
<div class="container">
<div class="col-xs-12 col-sm-6">
<blockquote>
"I am not going to hide that my sadness is huge. My heart is destroyed. But I still hold faith of playing at the World Cup. God makes the impossible possible. I believe in Him"
<div class="name">
Radamel Falcao
</div>
</blockquote>
</div>
<div class="col-xs-12 col-sm-6">
<blockquote class="blockquote-reverse">
"Van Gaal invests in me as a person. He is genuinely interested in my background, my thoughts, my ambitions, what I like to do in my spare time. He can be tough and demanding on the pitch but I need a coach that’s on my back. Off the pitch I’d rather describe him as a sweet person"
<div class="name">
Memphis Depay
</div>
</blockquote>
</div>
</div>
</div>
<div class="section style4">
<div class="container">
<div class="col-xs-12 col-sm-6">
<div class="box">
"The high point of my career was winning the Champions League. No one will ever erase that from my memory, in the same way that no one will ever erase the fact that I did it in a Manchester United shirt."
<div class="name">
Cristiano Ronaldo
</div><!-- /name -->
</div><!-- /box -->
</div><!-- /col-sm-6 -->
<div class="col-xs-12 col-sm-6">
<div class="box2">
"Small players learn to be intuitive, to anticipate, to protect the ball. A guy who weighs 90 kilos doesn't move like one who weighs 60. In the playground I always played against much bigger kids and I always wanted the ball. Without it, I feel lost."
<div class="name2">
Andres Iniesta
</div><!-- /name -->
</div><!-- /box -->
</div><!-- /col-sm-6 -->
</div>
</div>
<div class="section style5">
<div class="container">
<div class="col-xs-12">
<div class="box">
<div class="quote">
I have always considered myself to be very fortunate. To play for the biggest club in the world, which also happens to be the team I supported as a boy, means I have never had to consider changing away from Manchester United.
</div>
<div class="name">
- Ryan Giggs
</div>
</div>
</div>
</div>
</div>
<div class="section style6">
<div class="container">
<div class="col-xs-12 col-sm-8 col-sm-offset-2">
<blockquote>
<div class="name">
Carlos Tevez
</div>
I cannot ever imagine leaving Manchester United. I am in the perfect situation. My relationship with the club is perfect. Patrice Evra is my closest friend but the feeling I get from all the players is something I’ve not experienced before. I want to get the contract sorted and play for United for the rest of my career.
</blockquote>
</div>
<div class="col-xs-12 col-sm-8 col-sm-offset-2">
<blockquote class="block2">
<div class="name">
Eric Cantona
</div>
<div class="quote">
Sometimes you surprise the goalkeeper and sometimes the goalkeeper surprises you. In my career, I tried to do more of the first than the second.
</div>
</blockquote>
</div>
<div class="col-xs-12 col-sm-8 col-sm-offset-2">
<blockquote class="block3">
<div class="name">
Zinedine Zidane
</div>
<div class="quote">
I was lucky to come from a difficult area. It teaches you not just about football but also life. There were lots of kids from different races and poor families. People had to struggle to get through the day.
</div>
</blockquote>
</div>
<div class="col-xs-12 col-sm-8 col-sm-offset-2">
<blockquote class="block4">
<div class="name">
Luis Figo
</div>
<div class="quote">
Some of the fans here were not too sure about their club signing a player from their biggest rivals. Fortunately, we had a great season and won the League title for the first time in four years. Now, I think, everyone can say it was good business.
</div>
</blockquote>
</div>
</div>
</div>
<div class="section style7">
<div class="container">
<div class="col-xs-12 col-sm-8 col-sm-offset-2">
<div class="image">
<img src="http://static5.bornrichimages.com/cdn2/500/500/91/c/wp-content/uploads/2014/07/dav_thumb.jpg">
</div>
<div class="quote">
I'm a very stubborn person. I think it has helped me over my career. I'm sure it has hindered me at times as well, but not too many times. I know that if I set my mind to do something, even if people are saying I can't do it, I will achieve it.
</div>
<div class="name">
David Beckham
</div>
</div>
</div>
</div>
@import url('https://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700');
@import url('https://fonts.googleapis.com/css?family=Lato:300,400,800');
@import url('https://fonts.googleapis.com/css?family=Revalia');
body {
font-family: open sans;
}
.section {
padding: 70px 0;
}
.style1 {
font-family: open sans;
background: #011627;
.box {
padding: 10px;
background: #1A2D3D;
color: white;
font-size: 18px;
text-align: center;
}
.name {
text-align: right;
font-weight: bold;
color: #e71d36;
}
.box2 {
@extend .box;
background: none;
}
}
.style2 {
.box {
padding: 40px 30px;
background: #222;
color: white;
font-size: 16px;
.name {
font-size: 18px;
font-weight: bold;
text-transform: uppercase;
text-align: right;
margin-top: 10px;
}
}
}
.style3 {
background: #028090;
blockquote {
border-color: #114b5f;
color: white;
font-size: 20px;
.name {
color: #e4fde1;
margin-top: 10px;
font-size: 14px;
font-weight: bold;
}
}
}
.style4 {
text-align: center;
.box {
padding: 20px 0;
font-size: 18px;
color: #e71d36;
.name {
margin-top: 20px;
font-size: 13px;
color: black;
}
&:before, &:after {
content: '';
position: absolute;
background: #999;
width: 20%;
height: 1px;
left: 40%;
}
&:before {
top: -1px;
}
&:after {
bottom: -1px;
}
}
.box2 {
@extend .box;
color: #2D1E2F;
transition: 0.6s ease-in-out;
.name2 {
@extend .name;
color: #e71d36;
}
&:before, &:after {
background: #1C1F33;
transition: 0.6s ease-in-out;
}
&:hover {
&:before, &:after {
width: 60%;
left: 20%;
}
}
}
}
.style5 {
.box {
background: #555358;
border: 8px solid #696773;
padding: 40px;
color: white;
font-size: 20px;
.name {
text-align: right;
font-weight: 300;
}
&:before, &:after {
font-family: Revalia;
color: #696773;
font-size: 100px;
position: absolute;
}
&:before {
content: '“';
top: -40px;
left: 20px;
}
&:after {
content: '”';
bottom: -62px;
right: 20px;
}
}
}
.style6 {
blockquote {
border-right: 1px solid;
border-left: 10px solid;
border-color: #ED5565;
}
.name {
color: #ED5565;
margin-bottom: 8px;
text-transform: uppercase;
font-weight: bold;
font-size: 16px;
letter-spacing: -1px;
}
.block2 {
.name {
display: inline-block;
border-bottom: 3px solid;
width: 60%;
padding-bottom: 8px;
}
}
.block3 {
@extend .block2;
position: relative;
.quote {
padding-bottom: 8px;
}
&:before {
height: 2px;
background: #ED5565;
position: absolute;
content: '';
bottom: 0;
right: 20px;
left: 60%
}
}
.block4 {
@extend .block3;
.name {
border: none;
padding: 0;
}
&:before {
right: 100%;
transition: 0.7s;
}
&:after {
height: 2px;
background: white;
position: absolute;
content: '';
bottom: 0;
right: 40%;
left: 0;
}
.quote {
position: relative;
padding-top: 8px;
&:before {
height: 2px;
background: #ED5565;
position: absolute;
content: '';
top: 0;
left: 0;
right: 100%;
transition: 0.7s;
}
&:after {
height: 2px;
background: white;
position: absolute;
content: '';
top: 0;
left: 60%;
right: 0%;
}
}
&:hover {
&:before {
right: 20px;
}
.quote {
&:before {
right: 0%;
}
}
}
}
}
.style7 {
text-align: center;
img {
height: 100px;
width: 100px;
border-radius: 50px;
margin: auto;
}
.image {
display: inline-block;
border-radius: 50%;
border: 1px solid #ccc;
margin: auto;
padding: 4px;
margin-bottom: 10px;
}
.quote {
margin-bottom: 10px;
font-size: 18px;
font-weight: 300;
}
.name {
color: #e71d36;
font-weight: bold;
}
}
// double underline
// Small slightly thick red line with 1px full width grey line underneath
Also see: Tab Triggers