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="wrapper">
<div class="marquee">
<div class="marquee__group">
<div class="marquee__child">
<svg>
<use xlink:href="#screwdriver" />
</svg>
</div>
<div class="marquee__child">
<svg>
<use xlink:href="#paint-brush" />
</svg>
</div>
<div class="marquee__child">
<svg>
<use xlink:href="#code-bracket" />
</svg>
</div>
<div class="marquee__child">
<svg>
<use xlink:href="#internet-globe" />
</svg>
</div>
<div class="marquee__child">
<svg>
<use xlink:href="#rocket" />
</svg>
</div>
<div class="marquee__child">
<svg>
<use xlink:href="#bug-ant" />
</svg>
</div>
</div>
<div aria-hidden="true" class="marquee__group">
<div class="marquee__child">
<svg>
<use xlink:href="#screwdriver" />
</svg>
</div>
<div class="marquee__child">
<svg>
<use xlink:href="#paint-brush" />
</svg>
</div>
<div class="marquee__child">
<svg>
<use xlink:href="#code-bracket" />
</svg>
</div>
<div class="marquee__child">
<svg>
<use xlink:href="#internet-globe" />
</svg>
</div>
<div class="marquee__child">
<svg>
<use xlink:href="#rocket" />
</svg>
</div>
<div class="marquee__child">
<svg>
<use xlink:href="#bug-ant" />
</svg>
</div>
</div>
</div>
<div class="marquee marquee--reverse">
<div class="marquee__group">
<div class="big__marquee__child">
<p>Drupal</p>
</div>
<div class="big__marquee__child">
<p>Wartungsarbeiten</p>
</div>
<div class="big__marquee__child">
<p>neues Design</p>
</div>
<div class="big__marquee__child">
<p>Performance</p>
</div>
<div class="big__marquee__child">
<p>Website-Relaunch</p>
</div>
<div class="big__marquee__child">
<p>Modernes CMS</p>
</div>
</div>
<div aria-hidden="true" class="marquee__group">
<div class="big__marquee__child">
<p>Drupal</p>
</div>
<div class="big__marquee__child">
<p>Wartungsarbeiten</p>
</div>
<div class="big__marquee__child">
<p>neues Design</p>
</div>
<div class="big__marquee__child">
<p>Performance</p>
</div>
<div class="big__marquee__child">
<p>Website-Relaunch</p>
</div>
<div class="big__marquee__child">
<p>Modernes CMS</p>
</div>
</div>
</div>
<div class="marquee">
<div class="marquee__group">
<div class="marquee__child">
<svg>
<use xlink:href="#bug-ant" />
</svg>
</div>
<div class="marquee__child">
<svg>
<use xlink:href="#rocket" />
</svg>
</div>
<div class="marquee__child">
<svg>
<use xlink:href="#internet-globe" />
</svg>
</div>
<div class="marquee__child">
<svg>
<use xlink:href="#code-bracket" />
</svg>
</div>
<div class="marquee__child">
<svg>
<use xlink:href="#paint-brush" />
</svg>
</div>
<div class="marquee__child">
<svg>
<use xlink:href="#screwdriver" />
</svg>
</div>
</div>
<div aria-hidden="true" class="marquee__group">
<div class="marquee__child">
<svg>
<use xlink:href="#bug-ant" />
</svg>
</div>
<div class="marquee__child">
<svg>
<use xlink:href="#rocket" />
</svg>
</div>
<div class="marquee__child">
<svg>
<use xlink:href="#internet-globe" />
</svg>
</div>
<div class="marquee__child">
<svg>
<use xlink:href="#code-bracket" />
</svg>
</div>
<div class="marquee__child">
<svg>
<use xlink:href="#paint-brush" />
</svg>
</div>
<div class="marquee__child">
<svg>
<use xlink:href="#screwdriver" />
</svg>
</div>
</div>
</div>
</div>
<svg styles="display:none" xmlns="http://www.w3.org/2000/svg">
<defs>
<symbol id="bug-ant" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round" d="M12 12.75c1.148 0 2.278.08 3.383.237 1.037.146 1.866.966 1.866 2.013 0 3.728-2.35 6.75-5.25 6.75S6.75 18.728 6.75 15c0-1.046.83-1.867 1.866-2.013A24.204 24.204 0 0 1 12 12.75Zm0 0c2.883 0 5.647.508 8.207 1.44a23.91 23.91 0 0 1-1.152 6.06M12 12.75c-2.883 0-5.647.508-8.208 1.44.125 2.104.52 4.136 1.153 6.06M12 12.75a2.25 2.25 0 0 0 2.248-2.354M12 12.75a2.25 2.25 0 0 1-2.248-2.354M12 8.25c.995 0 1.971-.08 2.922-.236.403-.066.74-.358.795-.762a3.778 3.778 0 0 0-.399-2.25M12 8.25c-.995 0-1.97-.08-2.922-.236-.402-.066-.74-.358-.795-.762a3.734 3.734 0 0 1 .4-2.253M12 8.25a2.25 2.25 0 0 0-2.248 2.146M12 8.25a2.25 2.25 0 0 1 2.248 2.146M8.683 5a6.032 6.032 0 0 1-1.155-1.002c.07-.63.27-1.222.574-1.747m.581 2.749A3.75 3.75 0 0 1 15.318 5m0 0c.427-.283.815-.62 1.155-.999a4.471 4.471 0 0 0-.575-1.752M4.921 6a24.048 24.048 0 0 0-.392 3.314c1.668.546 3.416.914 5.223 1.082M19.08 6c.205 1.08.337 2.187.392 3.314a23.882 23.882 0 0 1-5.223 1.082" />
</symbol>
<symbol id="internet-globe" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round" d="M12 21a9.004 9.004 0 0 0 8.716-6.747M12 21a9.004 9.004 0 0 1-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 0 1 7.843 4.582M12 3a8.997 8.997 0 0 0-7.843 4.582m15.686 0A11.953 11.953 0 0 1 12 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0 1 21 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0 1 12 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 0 1 3 12c0-1.605.42-3.113 1.157-4.418" />
</symbol>
<symbol id="paint-brush" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round" d="M9.53 16.122a3 3 0 0 0-5.78 1.128 2.25 2.25 0 0 1-2.4 2.245 4.5 4.5 0 0 0 8.4-2.245c0-.399-.078-.78-.22-1.128Zm0 0a15.998 15.998 0 0 0 3.388-1.62m-5.043-.025a15.994 15.994 0 0 1 1.622-3.395m3.42 3.42a15.995 15.995 0 0 0 4.764-4.648l3.876-5.814a1.151 1.151 0 0 0-1.597-1.597L14.146 6.32a15.996 15.996 0 0 0-4.649 4.763m3.42 3.42a6.776 6.776 0 0 0-3.42-3.42" />
</symbol>
<symbol id="rocket" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round" d="M15.59 14.37a6 6 0 0 1-5.84 7.38v-4.8m5.84-2.58a14.98 14.98 0 0 0 6.16-12.12A14.98 14.98 0 0 0 9.631 8.41m5.96 5.96a14.926 14.926 0 0 1-5.841 2.58m-.119-8.54a6 6 0 0 0-7.381 5.84h4.8m2.581-5.84a14.927 14.927 0 0 0-2.58 5.84m2.699 2.7c-.103.021-.207.041-.311.06a15.09 15.09 0 0 1-2.448-2.448 14.9 14.9 0 0 1 .06-.312m-2.24 2.39a4.493 4.493 0 0 0-1.757 4.306 4.493 4.493 0 0 0 4.306-1.758M16.5 9a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z" />
</symbol>
<symbol id="screwdriver" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round" d="M11.42 15.17 17.25 21A2.652 2.652 0 0 0 21 17.25l-5.877-5.877M11.42 15.17l2.496-3.03c.317-.384.74-.626 1.208-.766M11.42 15.17l-4.655 5.653a2.548 2.548 0 1 1-3.586-3.586l6.837-5.63m5.108-.233c.55-.164 1.163-.188 1.743-.14a4.5 4.5 0 0 0 4.486-6.336l-3.276 3.277a3.004 3.004 0 0 1-2.25-2.25l3.276-3.276a4.5 4.5 0 0 0-6.336 4.486c.091 1.076-.071 2.264-.904 2.95l-.102.085m-1.745 1.437L5.909 7.5H4.5L2.25 3.75l1.5-1.5L7.5 4.5v1.409l4.26 4.26m-1.745 1.437 1.745-1.437m6.615 8.206L15.75 15.75M4.867 19.125h.008v.008h-.008v-.008Z" />
</symbol>
<symbol id="code-bracket" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round" d="M17.25 6.75 22.5 12l-5.25 5.25m-10.5 0L1.5 12l5.25-5.25m7.5-3-4.5 16.5" />
</symbol>
</defs>
</svg>
/* At the root we define custome properties, so we can reuse them later instead of duplicating */
:root {
--color-text: white; /* Specifies the text-color to the value */
--color-bg: white; /* Specifies the color of the background to the value */
--color-bg-item: #A4D233;/* Specifies the background color for a specific element to the value */
--size: clamp(18rem, 1rem + 40vmin, 30rem);
--gap: calc(var(--size) / 14); /* Specifies the gap between each element */
--duration: 50s; /* Specifies the duration of the animation */
--scroll-start: 0; /* Specifies the start position for the animation */
--scroll-end: calc(-100% - var(--gap)); /* Calculation and specifying the end position of the animation */
}
/* border-box style essentially ensures that padding and borders will be included in the specified width and height of all elements, simplifying layout calculations and helping to avoid unexpected layout issues. */
* {
box-sizing: border-box;
}
/* the body element contains all the content that you see rendered in the browser window, including text, images, links, videos, forms, and any other elements that make up the main content of the webpage. */
body {
width: 100%; /* Specifies the width of the body element */
min-height: 100vh; /* Specifies the minimal width that the body element should have */
font-family: monospace, sans-serif; /* Specifies and sets the font-family(the text style) to the value */
font-size: 1rem; /* Specifies the font-size */
line-height: 1.5; /* Specifies and determines the vertical spacing between lines of text */
color: var(--color-text); /* Specifies the text color of the body */
background-color: var(--color-bg); /* Specifies the background color of the body */
overflow: hidden;
}
.marquee {
display: flex; /* Specifies that the marquee element should be displayed as a flex container */
overflow: hidden; /* Specifies that any content overflowing the marquee element should be hidden */
user-select: none; /* Specifies that text within the marquee element cannot be selected by the user */
gap: var(--gap); /* Specifies the gap between child elements within the marquee */
mask-image: linear-gradient(
var(--mask-direction, to right), /* Specifies the gradient direction for the mask image */
hsl(0 0% 0% / 0), /* Specifies the color of the mask gradient at the start */
hsl(0 0% 0% / 1) 20%, /* Specifies the color of the mask gradient at 20% */
hsl(0 0% 0% / 1) 80%, /* Specifies the color of the mask gradient at 80% */
hsl(0 0% 0% / 0) /* Specifies the color of the mask gradient at the end */
);
}
.marquee__group {
flex-shrink: 0; /* Specifies that the element should not shrink to fit its content */
display: flex; /* Specifies that the element should be displayed as a flex container */
align-items: center; /* Specifies that child elements should be vertically centered */
justify-content: space-around; /* Specifies that child elements should be evenly distributed with equal space around them */
gap: var(--gap); /* Specifies the gap between child elements */
min-width: 100%; /* Specifies the minimum width that the element should have */
animation: scroll-x var(--duration) linear infinite; /* Specifies an animation named scroll-x to be applied to the marquee__group element */
}
/* the marquee--reverse class is for reversing animation within the marquee */
.marquee--reverse .marquee__group {
animation-direction: reverse; /* Specifies that the animation direction of the marquee__group element should be reversed */
animation-delay: -3s; /* Specifies a delay of 3 seconds before starting the animation */
}
/* defines the keyframes for the scroll-x animation */
@keyframes scroll-x {
from {
transform: translateX(var(--scroll-start)); /* Specifies the starting position of the animation */
}
to {
transform: translateX(var(--scroll-end)); /* Specifies the ending position of the animation */
}
}
.marquee__child {
display: grid; /* Specifies that the element should be displayed as a grid container */
place-items: center; /* Specifies that elements within the marquee__child should be centered both horizontally and vertically */
width: var(--size); /* Specifies the width of the element */
fill: var(--color-text); /* Specifies the fill color */
background: var(--color-bg-item); /* Specifies the background color */
aspect-ratio: 16/9; /* Specifies the aspect ratio (width-to-height ratio) */
padding: calc(var(--size) / 10); /* Specifies the padding, calculated based on the value of the custom CSS variable --size */
border-radius: 0.5rem; /* Specifies the border radius of the element */
}
.big__marquee__child {
display: grid; /* Specifies that the element should be displayed as a grid container */
place-items: center; /* Specifies that elements within the marquee__child should be centered both horizontally and vertically */
width: calc(var(--size) + 200px); /* Specifies the width of the element */
fill: var(--color-text); /* Specifies the fill color */
background: var(--color-bg-item); /* Specifies the background color */
aspect-ratio: 16/9; /* Specifies the aspect ratio (width-to-height ratio) */
padding: calc(var(--size) / 10); /* Specifies the padding, calculated based on the value of the custom CSS variable --size */
border-radius: 0.5rem; /* Specifies the border radius of the element */
font-size: 2rem;
}
svg {
width: 100%; /* Specifies the width of the SVG */
height: 100%; /* Specifies the height of the SVG */
}
.wrapper {
display: flex; /* Specifies that the wrapper element should be displayed as a flex container */
flex-direction: column; /* Specifies the flex direction of the wrapper element to be column, arranging child elements vertically */
gap: var(--gap); /* Specifies the gap between child elements within the wrapper */
max-width: 100vw; /* Specifies the maximum width of the wrapper element to be 100% of the viewport width */
transform: rotate(28deg); /* Specifies a rotation transformation for the wrapper element */
}
Also see: Tab Triggers