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="pmsteps-container">
<h1 class="pmsteps-title" style="text-align:center;font-weight:normal;">The Simplest Process for Finding Health Treatment at <br> <strong>Zero Cost, Zero Worries & complete peace of mind</strong></h1>
<div class="pmsteps-process">
<div class="pmsteps-step pmsteps-step-1"><div class="pmsteps-step-circle">1</div><div class="pmsteps-step-label">Explore & Match</div><div class="pmsteps-step-connector"></div></div>
<div class="pmsteps-step pmsteps-step-2"><div class="pmsteps-step-circle">2</div><div class="pmsteps-step-label">Doctor Opinion & Diagnosis</div><div class="pmsteps-step-connector"></div></div>
<div class="pmsteps-step pmsteps-step-3"><div class="pmsteps-step-circle">3</div><div class="pmsteps-step-label">Cost Estimate</div><div class="pmsteps-step-connector"></div></div>
<div class="pmsteps-step pmsteps-step-4"><div class="pmsteps-step-circle">4</div><div class="pmsteps-step-label">Medical Visa</div><div class="pmsteps-step-connector"></div></div>
<div class="pmsteps-step pmsteps-step-5"><div class="pmsteps-step-circle">5</div><div class="pmsteps-step-label">On Filed Assistance</div><div class="pmsteps-step-connector"></div></div>
<div class="pmsteps-step pmsteps-step-6"><div class="pmsteps-step-circle">6</div><div class="pmsteps-step-label">Treat & Get Fit</div><div class="pmsteps-step-connector"></div></div>
</div>
<div style="text-align:center;">
<div class="pmsteps-footer-note" style="display:inline-block;">
*We do not collect any charges
</div>
</div>
</div>
body{
margin: auto 2%;
}
.pmsteps-process {
display: flex;
flex-wrap: wrap; /* Allow wrapping for responsive behavior */
justify-content: space-between;
align-items: center;
gap: 1rem;
position: relative;
padding: 2rem 0;
}
.pmsteps-step {
flex: 1;
text-align: center;
min-width: 120px; /* Ensure each step has a minimum width */
max-width: 200px; /* Limit maximum width for better spacing on smaller screens */
position: relative;
min-height: 90px;
overflow: hidden; /* Ensure the pseudo-element stays within bounds */
}
/* Custom hover animations for the step circle */
.pmsteps-step:hover .pmsteps-step-circle {
animation: pmsteps-tada 0.5s ease-in-out, pmsteps-swing 0.5s ease-in-out, pmsteps-balloon 0.5s ease-in-out; /* Combine all three animations */
transform: scale(1.1); /* Keep the existing scale effect */
}
/* Custom Animation: Tada (shaking and slight scaling) */
@keyframes pmsteps-tada {
0% { transform: scale(1); }
10%, 20% { transform: scale(1.1) rotate(-3deg); }
30%, 50%, 70%, 90% { transform: scale(1.1) rotate(3deg); }
40%, 60%, 80% { transform: scale(1.1) rotate(-3deg); }
100% { transform: scale(1.1) rotate(0); }
}
/* Custom Animation: Swing (pendulum-like motion with left-to-right/right-to-left movement) */
@keyframes pmsteps-swing {
0% { transform: rotate(0deg) translateX(0); }
20% { transform: rotate(15deg) translateX(10px); } /* Swing right and move right */
40% { transform: rotate(-10deg) translateX(-10px); } /* Swing left and move left */
60% { transform: rotate(5deg) translateX(5px); } /* Swing right and move right (smaller) */
80% { transform: rotate(-5deg) translateX(-5px); } /* Swing left and move left (smaller) */
100% { transform: rotate(0deg) translateX(0); } /* Return to center */
}
/* Custom Animation: Balloon (gentle bouncing/floating effect) */
@keyframes pmsteps-balloon {
0% { transform: translateY(0); }
50% { transform: translateY(-10px); }
100% { transform: translateY(0); }
}
/* Step bottom border with rounded corners */
.pmsteps-step::after {
content: '';
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 10px; /* Match the border thickness */
border-radius: 0 0 10px 10px; /* Rounded corners at the bottom */
z-index: -1; /* Place behind other content */
}
/* Color progression for step circles, connectors, labels, and the bottom border (via ::after) */
.pmsteps-step-1 .pmsteps-step-circle { background-color: #4a47a3; }
.pmsteps-step-1 .pmsteps-step-connector { background: repeating-linear-gradient(to bottom, #4a47a3, #4a47a3 2px, transparent 2px, transparent 4px); }
.pmsteps-step-1 .pmsteps-step-label { color: #4a47a3; }
.pmsteps-step-1::after { background-color: #4a47a3; }
.pmsteps-step-2 .pmsteps-step-circle { background-color: #007bff; }
.pmsteps-step-2 .pmsteps-step-connector { background: repeating-linear-gradient(to bottom, #007bff, #007bff 2px, transparent 2px, transparent 4px); }
.pmsteps-step-2 .pmsteps-step-label { color: #007bff; }
.pmsteps-step-2::after { background-color: #007bff; }
.pmsteps-step-3 .pmsteps-step-circle { background-color: #00b4d8; }
.pmsteps-step-3 .pmsteps-step-connector { background: repeating-linear-gradient(to bottom, #00b4d8, #00b4d8 2px, transparent 2px, transparent 4px); }
.pmsteps-step-3 .pmsteps-step-label { color: #00b4d8; }
.pmsteps-step-3::after { background-color: #00b4d8; }
.pmsteps-step-4 .pmsteps-step-circle { background-color: #0096c7; }
.pmsteps-step-4 .pmsteps-step-connector { background: repeating-linear-gradient(to bottom, #0096c7, #0096c7 2px, transparent 2px, transparent 4px); }
.pmsteps-step-4 .pmsteps-step-label { color: #0096c7; }
.pmsteps-step-4::after { background-color: #0096c7; }
.pmsteps-step-5 .pmsteps-step-circle { background-color: #2ecc71; }
.pmsteps-step-5 .pmsteps-step-connector { background: repeating-linear-gradient(to bottom, #2ecc71, #2ecc71 2px, transparent 2px, transparent 4px); }
.pmsteps-step-5 .pmsteps-step-label { color: #2ecc71; }
.pmsteps-step-5::after { background-color: #2ecc71; }
.pmsteps-step-6 .pmsteps-step-circle { background-color: #27ae60; }
.pmsteps-step-6 .pmsteps-step-connector { background: repeating-linear-gradient(to bottom, #27ae60, #27ae60 2px, transparent 2px, transparent 4px); }
.pmsteps-step-6 .pmsteps-step-label { color: #27ae60; }
.pmsteps-step-6::after { background-color: #27ae60; }
.pmsteps-step-circle {
width: 30px;
height: 30px; /* Ensure consistent height */
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 14px;
font-weight: bold;
color: #fff;
margin: 0 auto 1rem; /* Consistent margin for all steps */
transition: transform 0.3s ease;
position: relative;
left: -75px; /* Keep the left positioning but ensure alignment */
top: 0; /* Reset any unintended top positioning */
}
.pmsteps-step-label {
font-size: clamp(0.8rem, 2vw, 1rem);
margin-top: 10px; /* Add consistent spacing between circle and label */
position: absolute;
bottom: 10px;
right: 15px;
width: 120px;
font-weight: 600;
padding-bottom:10px;
}
.pmsteps-line {
height: 0px;
position: absolute;
top: 15px;
width: 100%;
background-color: #007bff;
z-index: 1;
}
.pmsteps-step-connector {
position: absolute;
width: 2px;
height: 50px; /* Consistent height for all connectors */
top: 10px; /* Align with the bottom of the circle */
left: 11% !important; /* Center the connector under the circle relative to its parent */
transform: translateX(-50%) translateY(15px); /* Adjust vertically to align with circle bottom and center horizontally */
z-index: 2;
}
/* Ensure connectors follow the circle's position */
.pmsteps-step-1 .pmsteps-step-connector { background: repeating-linear-gradient(to bottom, #4a47a3, #4a47a3 2px, transparent 2px, transparent 4px); }
.pmsteps-step-2 .pmsteps-step-connector { background: repeating-linear-gradient(to bottom, #007bff, #007bff 2px, transparent 2px, transparent 4px); }
.pmsteps-step-3 .pmsteps-step-connector { background: repeating-linear-gradient(to bottom, #00b4d8, #00b4d8 2px, transparent 2px, transparent 4px); }
.pmsteps-step-4 .pmsteps-step-connector { background: repeating-linear-gradient(to bottom, #0096c7, #0096c7 2px, transparent 2px, transparent 4px); }
.pmsteps-step-5 .pmsteps-step-connector { background: repeating-linear-gradient(to bottom, #2ecc71, #2ecc71 2px, transparent 2px, transparent 4px); }
.pmsteps-step-6 .pmsteps-step-connector { background: repeating-linear-gradient(to bottom, #27ae60, #27ae60 2px, transparent 2px, transparent 4px); }
.pmsteps-footer-note {
text-align: center;
margin-top: 2rem;
padding: 1rem 2rem;
background-color: #f0f8ff;
color: #666;
border-radius: 20px;
font-size: clamp(0.8rem, 2vw, 1rem);
display: inline-block;
}
/* Animations */
@keyframes pmsteps-fadeIn {
from { opacity: 0; transform: translateY(20px); }
to { opacity: 1; transform: translateY(0); }
}
.pmsteps-step {
animation: pmsteps-fadeIn 0.5s ease-out forwards;
}
.pmsteps-step:nth-child(1) { animation-delay: 0.1s; }
.pmsteps-step:nth-child(2) { animation-delay: 0.3s; }
.pmsteps-step:nth-child(3) { animation-delay: 0.5s; }
.pmsteps-step:nth-child(4) { animation-delay: 0.7s; }
.pmsteps-step:nth-child(5) { animation-delay: 0.9s; }
.pmsteps-step:nth-child(6) { animation-delay: 1.1s; }
/* Responsive design */
@media (max-width: 576px) {
/* Mobile View: Single step per row */
.pmsteps-process {
flex-direction: column; /* Stack steps vertically */
align-items: center; /* Center steps */
gap: 1.5rem; /* Increase gap for better spacing */
padding: 1rem 0; /* Reduce padding for mobile */
}
.pmsteps-step {
flex: 100%; /* Full width for each step */
min-width: 100%; /* Ensure full width */
max-width: 100%; /* Ensure full width */
margin: 0; /* Remove margins for stacking */
}
.pmsteps-step-circle {
left: 0; /* Center circle on mobile */
margin-bottom: 0.5rem;
}
.pmsteps-step-label {
position: static; /* Reset to static positioning for stacking */
width: auto; /* Allow full width */
margin-top: 0.5rem; /* Adjust spacing */
right: auto; /* Reset right positioning */
bottom: auto; /* Reset bottom positioning */
}
.pmsteps-step-connector {
display: none; /* Hide connectors on mobile since steps stack */
}
.pmsteps-line {
display: none; /* Hide the horizontal line on mobile */
}
.pmsteps-step::after {
border-radius: 0; /* Remove border radius on mobile for simplicity */
}
/* Remove hover animations on mobile for better usability */
.pmsteps-step:hover .pmsteps-step-circle {
animation: none;
transform: scale(1); /* Reset scale on mobile hover */
}
}
@media (min-width: 577px) and (max-width: 1024px) {
/* Tablet View: 2–3 steps per row */
.pmsteps-process {
flex-wrap: wrap; /* Allow wrapping for 2–3 steps */
justify-content: space-around; /* Distribute steps evenly */
gap: 1rem; /* Maintain gap */
}
.pmsteps-step {
flex: 0 1 calc(33.33% - 1rem); /* Approximately 3 steps per row, accounting for gap */
max-width: calc(33.33% - 1rem); /* Limit to about 1/3 of the container width */
min-width: 120px; /* Minimum width to ensure readability */
}
.pmsteps-step-circle {
left: -75px; /* Maintain desktop positioning */
}
.pmsteps-step-label {
position: absolute; /* Keep label positioned absolutely */
bottom: 10px;
right: 15px;
width: 120px;
}
.pmsteps-step-connector {
left: 50%; /* Center the connector under the circle */
transform: translateX(-50%) translateY(15px); /* Maintain alignment with circle */
}
.pmsteps-line {
display: block; /* Keep the horizontal line visible */
}
.pmsteps-step::after {
border-radius: 0 0 10px 10px; /* Maintain rounded corners */
}
/* Adjust for narrower tablets (2 steps per row) */
@media (max-width: 768px) {
.pmsteps-step {
flex: 0 1 calc(50% - 1rem); /* 2 steps per row on narrower tablets */
max-width: calc(50% - 1rem); /* Limit to half the container width */
}
}
}
@media (min-width: 1025px) {
/* Desktop View: All 6 steps in a single row */
.pmsteps-process {
justify-content: space-between; /* Distribute steps evenly across the full width */
}
.pmsteps-step {
flex: 1; /* Allow equal distribution */
max-width: 200px; /* Maintain maximum width */
min-width: 120px; /* Maintain minimum width */
}
.pmsteps-step-circle {
left: -75px; /* Maintain desktop positioning */
}
.pmsteps-step-label {
position: absolute; /* Keep label positioned absolutely */
bottom: 10px;
right: 15px;
width: 120px;
}
.pmsteps-step-connector {
left: 50%; /* Center the connector under the circle */
transform: translateX(-50%) translateY(15px); /* Maintain alignment with circle */
}
.pmsteps-line {
display: block; /* Keep the horizontal line visible */
}
.pmsteps-step::after {
border-radius: 0 0 10px 10px; /* Maintain rounded corners */
}
}
Also see: Tab Triggers