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="movie_card" id="bright">
<div class="info_section">
<div class="movie_header">
<img class="locandina" src="https://movieplayer.net-cdn.it/t/images/2017/12/20/bright_jpg_191x283_crop_q85.jpg"/>
<h1>Bright</h1>
<h4>2017, David Ayer</h4>
<span class="minutes">117 min</span>
<p class="type">Action, Crime, Fantasy</p>
</div>
<div class="movie_desc">
<p class="text">
Set in a world where fantasy creatures live side by side with humans. A human cop is forced to work with an Orc to find a weapon everyone is prepared to kill for.
</p>
</div>
<div class="movie_social">
<ul>
<li><i class="material-icons">share</i></li>
<li><i class="material-icons"></i></li>
<li><i class="material-icons">chat_bubble</i></li>
</ul>
</div>
</div>
<div class="blur_back bright_back"></div>
</div>
<div class="movie_card" id="tomb">
<div class="info_section">
<div class="movie_header">
<img class="locandina" src="https://mr.comingsoon.it/imgdb/locandine/235x336/53750.jpg"/>
<h1>Tomb Raider</h1>
<h4>2018, Roar Uthaug</h4>
<span class="minutes">125 min</span>
<p class="type">Action, Fantasy</p>
</div>
<div class="movie_desc">
<p class="text">
Lara Croft, the fiercely independent daughter of a missing adventurer, must push herself beyond her limits when she finds herself on the island where her father disappeared.
</p>
</div>
<div class="movie_social">
<ul>
<li><i class="material-icons">share</i></li>
<li><i class="material-icons"></i></li>
<li><i class="material-icons">chat_bubble</i></li>
</ul>
</div>
</div>
<div class="blur_back tomb_back"></div>
</div>
<div class="movie_card" id="ave">
<div class="info_section">
<div class="movie_header">
<img class="locandina" src="https://mr.comingsoon.it/imgdb/locandine/235x336/53715.jpg"/>
<h1>Black Panther</h1>
<h4>2018, Ryan Coogler</h4>
<span class="minutes">134 min</span>
<p class="type">Action, Adventure, Sci-Fi</p>
</div>
<div class="movie_desc">
<p class="text">
T'Challa, the King of Wakanda, rises to the throne in the isolated, technologically advanced African nation, but his claim is challenged by a vengeful outsider who was a childhood victim of T'Challa's father's mistake.
</p>
</div>
<div class="movie_social">
<ul>
<li><i class="material-icons">share</i></li>
<li><i class="material-icons"></i></li>
<li><i class="material-icons">chat_bubble</i></li>
</ul>
</div>
</div>
<div class="blur_back ave_back"></div>
</div>
@import url('https://fonts.googleapis.com/css?family=Montserrat:300,400,700,800');
*{
box-sizing: border-box;
margin: 0;
}
html, body{
margin: 0;
background: black;
font-family: 'Montserrat', helvetica, arial, sans-serif;
font-size: 14px;
font-weight: 400;
}
.movie_card{
position: relative;
display: block;
width: 800px;
height: 350px;
margin: 100px auto;
overflow: hidden;
border-radius: 10px;
transition: all 0.4s;
&:hover{
transform: scale(1.02);
transition: all 0.4s;
}
.info_section{
position: relative;
width: 100%;
height: 100%;
background-blend-mode: multiply;
z-index: 2;
border-radius: 10px;
.movie_header{
position: relative;
padding: 25px;
height: 40%;
h1{
color: #fff;
font-weight: 400;
}
h4{
color: #9ac7fa;
font-weight: 400;
}
.minutes{
display: inline-block;
margin-top: 10px;
color: #fff;
padding: 5px;
border-radius: 5px;
border: 1px solid rgba(255,255,255,0.13);
}
.type{
display: inline-block;
color: #cee4fd;
margin-left: 10px;
}
.locandina{
position: relative;
float: left;
margin-right: 20px;
height: 120px;
box-shadow: 0 0 20px -10px rgba(0,0,0,0.5);
}
}
.movie_desc{
padding: 25px;
height: 50%;
.text{
color: #cfd6e1;
}
}
.movie_social{
height: 10%;
padding-left: 15px;
padding-bottom: 20px;
ul{
list-style: none;
padding: 0;
li{
display: inline-block;
color: rgba(255,255,255,0.4);
transition: color 0.3s;
transition-delay: 0.15s;
margin: 0 10px;
&:hover{
transition: color 0.3s;
color: rgba(255,255,255,0.8);
}
i{
font-size: 19px;
cursor: pointer;
}
}
}
}
}
.blur_back{
position: absolute;
top: 0;
z-index: 1;
height: 100%; right: 0;
background-size: cover;
border-radius: 11px;
}
}
@media screen and (min-width: 768px) {
.movie_header{
width: 60%;
}
.movie_desc{
width: 50%;
}
.info_section{
background: linear-gradient(to right, #0d0d0c 50%, transparent 100%);
}
.blur_back{
width: 80%;
background-position: -100% 10% !important;
}
}
@media screen and (max-width: 768px) {
.movie_card{
width: 95%;
margin: 70px auto;
min-height: 350px;
height: auto;
}
.blur_back{
width: 100%;
background-position: 50% 50% !important;
}
.movie_header{
width: 100%;
margin-top: 85px;
}
.movie_desc{
width: 100%;
}
.info_section{
background: linear-gradient(to top, rgb(20, 20, 19) 50%, transparent 100%);
display: inline-grid;
}
}
#bright{
box-shadow: 0px 0px 150px -45px rgba(255, 51, 0, 0.5);
&:hover{
box-shadow: 0px 0px 120px -55px rgba(255, 51, 0, 0.5);
}
}
.bright_back{
background: url("https://occ-0-2433-448.1.nflxso.net/art/cd5c9/3e192edf2027c536e25bb5d3b6ac93ced77cd5c9.jpg");
}
#tomb{
box-shadow: 0px 0px 150px -45px rgba(19, 160, 134, 0.6);
&:hover{
box-shadow: 0px 0px 120px -55px rgba(19, 160, 134, 0.6);
}
}
.tomb_back{
background: url("https://fsmedia.imgix.net/cd/c9/5e/ba/4817/4d9a/93f0/c776ec32ecbc/lara-crofts-neck-looks-unnatural-in-the-new-poster-for-tomb-raider.png");
}
#ave{
box-shadow: 0px 0px 150px -45px rgba(199,147,75, 0.7);
margin-bottom: 200px;
&:hover{
box-shadow: 0px 0px 120px -55px rgba(199,147,75, 0.7);
}
}
.ave_back{
background: url("https://www.gannett-cdn.com/-mm-/c03fd140debe8ad4c05cf81a5cad7ad61a12ce52/c=0-1580-2985-3266&r=x803&c=1600x800/local/-/media/2017/06/09/USATODAY/USATODAY/636326272873599176-Black-Panther-Teaser.jpg");
}
Also see: Tab Triggers