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.
<head>
<link href="https://fonts.googleapis.com/css?family=Poppins&display=swap" rel="stylesheet">
</head>
<div class="container">
<h3 class="subtitle">Try hovering over the card and the button. <i class="em em-dizzy"></i></h3>
<div class="card-box">
<img src="https://i.ibb.co/ZKWrYbr/therapist-photo.png" alt="therapist-photo" class="photo">
<div class="info">
<h3 class="therapist-name">Jessica Le Fleur</h3>
<div class="title">Licensed Nutritionist</div>
<div class="languages">English, French</div>
<div class="divider"></div>
</div>
<div class="location">UTC +02 FR <i class="em em-fr"></i></div>
<div class="expertise">
<div class="expertise-area">Weightloss</div>
<div class="expertise-area">Longevity</div>
<div class="expertise-area">Plant based</div>
</div>
<div class="price-contact-wrapper">
<div class="price">USD 80 / hour</div>
<button class="cta">Visit website</button>
</div>
</div>
</div>
body {
font-family: Poppins;
background-color: #FFF3F0;
background-repeat: no-repeat;
background-size: cover;
background-position: center;
background-image: url("data:image/svg+xml,%3Csvg width='1142' height='363' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0)'%3E%3Cpath d='M205.619 77.089c9.182 4.885 37.28-5.769 45.504-21.025 8.198-15.352-6.579-29.503-15.69-34.51-9.182-4.886-23.274 3.559-31.497 18.814-8.198 15.353-7.428 31.713 1.683 36.72z' fill='%230500FF' opacity='.8'/%3E%3Cpath d='M98.103 229.761c13.651 50.816 120.019 81.71 170.441 68.166 50.423-13.545 89.728-83.57 76.078-134.386-13.651-50.816-44.092-79.552-108.274-21.006-38.664 35.305-151.895 36.41-138.245 87.226z' fill='%23E0DDFF' opacity='.8'/%3E%3C/g%3E%3Cpath d='M354.394 111.11c3.069-2.378 3.741-13.578-.195-18.713-3.974-5.141-11.054-2.275-14.154.061-3.069 2.379-2.35 8.47 1.586 13.606 3.974 5.141 9.663 7.383 12.763 5.046z' fill='%230500FF' opacity='.8'/%3E%3Cpath d='M166.909 339.382c16.553 8.806 67.206-10.4 82.032-37.902 14.779-27.677-11.861-53.187-28.286-62.215-16.552-8.807-41.956 6.417-56.781 33.919-14.779 27.676-13.389 57.17 3.035 66.198z' fill='%23FECEBF'/%3E%3Cpath d='M1049.81 299.762c43.95-11.776 70.73-103.742 59.04-147.352-11.68-43.611-72.22-77.638-116.169-65.861-43.951 11.776-68.817 38.085-18.223 93.618 30.512 33.455 31.402 131.372 75.352 119.595z' fill='%230500FF'/%3E%3Cpath d='M825.353 249.718c-1.394 10.307 18.349 32.961 35.511 35.378 17.243 2.36 25.386-16.409 26.92-26.692 1.395-10.307-11.415-20.592-28.577-23.009-17.243-2.36-32.319 4.04-33.854 14.323z' fill='%23FECEBF'/%3E%3Cpath d='M1084.34 333.011c-.88 6.502 11.58 20.794 22.41 22.32 10.88 1.488 16.01-10.353 16.98-16.841.88-6.502-7.2-12.99-18.03-14.516-10.88-1.489-20.39 2.549-21.36 9.037z' fill='%230500FF'/%3E%3Cg clip-path='url(%23clip1)'%3E%3Cpath d='M1071.45 176.402c-16.03-16.662-60.03-8.79-92.572 8.71-32.544 17.5-78.294 61.922-54.815 105.562 9.151 17.001 39.294 42.673 103.177-3.097 35.51-25.398 66.37-88.192 44.21-111.175z' fill='%23DDFFEF'/%3E%3C/g%3E%3Cpath d='M991.589 348.159c.923-5.745-9.774-18.465-19.3-20.104-9.487-1.525-14.248 8.826-15.209 14.458-.923 5.745 6.005 11.561 15.605 13.047 9.526 1.638 17.943-1.769 18.904-7.401z' fill='%23DDFFEF'/%3E%3Cdefs%3E%3CclipPath id='clip0'%3E%3Cpath fill='%23fff' transform='rotate(-15.036 307.893 40.389)' d='M0 0h313v272.1H0z'/%3E%3C/clipPath%3E%3CclipPath id='clip1'%3E%3Cpath fill='%23fff' transform='rotate(160.977 531.856 236.125)' d='M0 0h179.581v140.679H0z'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E ");
}
.subtitle {
color: #F19071;
text-align: center;
margin: auto;
margin-top: 150px;
}
.card-box {
background-color: white;
border-left: solid 20px #FECEBF;
width: 793px;
height: 264px;
border-radius: 18px;
box-shadow: 0px 4.5px 14px rgba(0, 0, 0, 0.1);
margin: auto;
margin-top: 50px;
display: grid;
grid-template-areas:
"photo info location price"
"expertise expertise expertise price";
grid-template-columns: 25% 1fr 1fr 1fr;
transition: all 0.2s ease-out;
&:hover {
box-shadow: 0px 6px 14px rgba(0, 0, 0, 0.12);
transform: translatey(-6px);
.photo{
transform: rotate(0.03turn);
}
}
}
.photo {
height: 136px;
margin-top: 36px;
margin-left: 40px;
transition: all 0.3s ease-out;
}
.info {
grid-area: info;
margin-top: 44px;
margin-left: -8px;
}
.location {
margin-top: 68px;
color: #0500FF;
font-size: 14px;
font-weight: bold;
}
h3 {
margin-bottom: 4px;
}
.title {
font-size: 14px;
font-weight: regular;
}
.languages {
font-size: 14px;
font-weight: regular;
color: grey;
}
.divider {
margin-top: 14px;
height: 2px;
width: 140px;
background-color: #FECEBF;
grid-area: info;
}
.expertise {
grid-area: expertise;
display: flex;
margin-left: 48px;
margin-bottom: 16px;
}
.expertise-area {
font-size: 14px;
line-height: 32px;
padding-left: 12px;
padding-right: 12px;
height: 32px;
background-color: #FECEBF;
margin-left: 4px;
margin-right: 4px;
border-radius: 100px;
}
.price-contact-wrapper {
grid-area: price;
margin-top: 50%;
}
.price {
margin-bottom: 4px;
font-weight: bold;
font-size: 18px;
}
button {
background-color: #0500ff;
color: white;
border: none;
font-size: 14px;
font-weight: bold;
border-radius: 25px;
height: 40px;
padding-left: 16px;
padding-right: 16px;
margin-top: 8px;
cursor: pointer;
transition: all 0.3s ease-out;
&:hover {
transform: translatey(-2px);
color: #FECEBF;
box-shadow: 0px 4px 4px rgba(254, 206, 191, 0.6);
}
}
Also see: Tab Triggers