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.
<body>
<section>
<div class="grain-bg"></div>
<div class="relative">
<span class="header-text">
transforming businesses
<svg viewBox="0 0 24 24"><path d="M5 12h14M12 5l7 7-7 7"/></svg>
</span>
<h1>Innovative Solutions for Modern Enterprises</h1>
<div class="grid">
<div class="card">
<div class="card-content">
<svg class="icon" viewBox="0 0 24 24"><path d="M12 19H5a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v5.5M16 19h3m-3-3h6M12 17v-7M8 15l4-4 4 4"/></svg>
<h2>UI/UX <br /> Design Excellence</h2>
<p>
Transform user experiences with our cutting-edge design solutions. We create intuitive, engaging interfaces that captivate your audience and drive conversions.
</p>
<button class="btn btn-glow">Learn More</button>
</div>
</div>
<div class="card">
<div class="card-content">
<svg class="icon" viewBox="0 0 24 24"><path d="M3 3v18h18M3 12h18M3 6h18M3 9h18M3 15h18M3 18h18M16 3l-4 18M8 3l4 18"/></svg>
<h2>Digital <br /> Marketing</h2>
<p>
Amplify your brand's reach with data-driven marketing strategies. We leverage advanced analytics to target, engage, and convert your ideal customers.
</p>
<button class="btn btn-glow">Explore Services</button>
</div>
</div>
<div class="card">
<div class="card-content">
<svg class="icon" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"/><circle cx="12" cy="12" r="6"/><circle cx="12" cy="12" r="2"/></svg>
<h2>Strategic <br /> Consulting</h2>
<p>
Navigate complex business challenges with our expert guidance. We provide actionable insights and strategies to accelerate your growth and innovation.
</p>
<button class="btn btn-glow">Get Started</button>
</div>
</div>
<div class="card">
<div class="card-content">
<svg class="icon" viewBox="0 0 24 24"><path d="m16 18 2-2-2-2M8 18l-2-2 2-2M12 12v4M7 4h10M12 4v4"/><path d="M8 8h8a4 4 0 0 1 4 4v4a4 4 0 0 1-4 4H8a4 4 0 0 1-4-4v-4a4 4 0 0 1 4-4Z"/></svg>
<h2>Custom <br /> Development</h2>
<p>
Build powerful, scalable solutions with our expert development team. We create custom applications that streamline operations and drive efficiency.
</p>
<button class="btn btn-glow">View Projects</button>
</div>
</div>
<div class="card">
<div class="card-content">
<svg class="icon" viewBox="0 0 24 24"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/></svg>
<h2>Security <br /> Solutions</h2>
<p>
Protect your digital assets with enterprise-grade security. We implement robust systems to safeguard your data and maintain compliance standards.
</p>
<button class="btn btn-glow">Learn More</button>
</div>
</div>
<div class="card">
<div class="card-content">
<svg class="icon" viewBox="0 0 24 24"><path d="M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z"/><path d="m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z"/><path d="M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0"/><path d="M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5"/></svg>
<h2>Innovation <br /> Labs</h2>
<p>
Stay ahead with emerging technology solutions. We help you leverage AI, blockchain, and IoT to create competitive advantages in your market.
</p>
<button class="btn btn-glow">Discover More</button>
</div>
</div>
</div>
</div>
</section>
</body>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: system-ui, -apple-system, sans-serif;
line-height: 1.5;
}
section {
min-height: 100vh;
background-color: rgb(2, 6, 23);
text-align: center;
padding: 5rem 2rem;
display: flex;
flex-direction: column;
justify-content: center;
position: relative;
overflow: hidden;
}
.grain-bg {
background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
opacity: 0.15;
pointer-events: none;
position: absolute;
inset: 0;
}
.header-text {
color: rgb(148, 163, 184);
font-size: 1.125rem;
max-width: 32rem;
margin: 0 auto 0.5rem;
text-transform: capitalize;
display: flex;
align-items: center;
justify-content: center;
}
.header-text svg {
color: #ff7f50;
margin-left: 0.75rem;
width: 1.5rem;
height: 1.5rem;
stroke: currentColor;
stroke-width: 2;
stroke-linecap: round;
stroke-linejoin: round;
fill: none;
}
h1 {
color: white;
font-size: clamp(2.25rem, 5vw, 3.75rem);
font-weight: 600;
max-width: 48rem;
margin: 0 auto 4rem;
line-height: 1.2;
}
.grid {
display: grid;
gap: 1.25rem;
max-width: 80rem;
margin: 0 auto;
text-align: left;
}
@media (min-width: 640px) {
.grid {
grid-template-columns: repeat(2, 1fr);
}
}
@media (min-width: 1024px) {
.grid {
grid-template-columns: repeat(3, 1fr);
}
section {
padding: 5rem 0;
}
}
.card {
background-color: rgba(15, 23, 42, 0.5);
backdrop-filter: blur(8px);
padding: 2.5rem;
position: relative;
transform: translateY(30px);
opacity: 0;
animation: fadeInUp 0.6s ease forwards;
}
.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }
.card:nth-child(5) { animation-delay: 0.5s; }
.card:nth-child(6) { animation-delay: 0.6s; }
@keyframes fadeInUp {
to {
transform: translateY(0);
opacity: 1;
}
}
.card {
transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.card:hover {
transform: scale(1.02) translateY(-5px);
box-shadow: 0 20px 40px -15px rgba(184, 216, 216, 0.3);
}
.card::before {
content: '';
position: absolute;
inset: 0;
transition: 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
z-index: 0;
background: linear-gradient(135deg, #ff7f50 0%, #ff6b6b 100%);
opacity: 0.9;
}
.card:nth-child(1)::before {
bottom: 0;
right: 0;
clip-path: circle(calc(6.25rem + 7.5vw) at 100% 100%);
}
.card:nth-child(2)::before {
bottom: 0;
left: 0;
clip-path: circle(calc(6.25rem + 7.5vw) at 0% 100%);
}
.card:nth-child(3)::before {
top: 0;
right: 0;
clip-path: circle(calc(6.25rem + 7.5vw) at 100% 0%);
}
.card:nth-child(4)::before {
top: 0;
left: 0;
clip-path: circle(calc(6.25rem + 7.5vw) at 0% 0%);
}
.card:nth-child(5)::before {
bottom: 0;
right: 0;
clip-path: circle(calc(6.25rem + 7.5vw) at 100% 100%);
}
.card:nth-child(6)::before {
bottom: 0;
left: 0;
clip-path: circle(calc(6.25rem + 7.5vw) at 0% 100%);
}
.card:hover::before {
clip-path: circle(150% at 100% 100%);
}
.card-content {
position: relative;
}
@media (min-width: 1024px) {
.card-content {
padding-right: 3rem;
}
.card:nth-child(even) .card-content {
padding-right: 0;
padding-left: 3rem;
}
}
.icon {
color: #ff7f50;
width: 2rem;
height: 2rem;
margin-bottom: 1rem;
transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
stroke: currentColor;
stroke-width: 2;
stroke-linecap: round;
stroke-linejoin: round;
fill: none;
}
.card:hover .icon {
transform: scale(1.1) rotate(5deg);
color: white;
}
h2 {
font-family: 'Playfair Display', serif;
text-transform: capitalize;
color: white;
margin-bottom: 1rem;
font-size: clamp(1.5rem, 3vw, 1.875rem);
line-height: 1.2;
}
.card p {
color: rgb(148, 163, 184);
margin-bottom: 1.5rem;
transition: color 0.8s;
}
.card:hover p {
color: white;
}
.btn {
background-color: #b8d8d8;
color: rgb(30, 41, 59);
padding: 0.5rem 1.5rem;
border-radius: 0.5rem;
transition: all 0.3s ease;
border: none;
cursor: pointer;
font-size: 1rem;
position: relative;
z-index: 10;
}
.btn:hover {
background-color: #a6c4c4;
}
.btn-glow {
position: relative;
}
.btn-glow::after {
content: '';
position: absolute;
top: -2px;
left: -2px;
right: -2px;
bottom: -2px;
background: linear-gradient(135deg, #c4e3e3 0%, #a6c4c4 100%);
border-radius: 0.5rem;
z-index: -1;
opacity: 0;
transition: opacity 0.3s ease;
}
.btn-glow:hover::after {
opacity: 0.5;
animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes pulse {
0%, 100% {
opacity: 0.5;
}
50% {
opacity: 0.2;
}
}
Also see: Tab Triggers