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. You can use the CSS from another Pen by using it's URL and the proper URL extention.
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 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.
<div class="holder">
<div class="card">
<div class="card__text">
8293 3412 5976 1254
<br />
<small>12/24</small>
</div>
<svg width="70px" viewBox="0 0 1001 324" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Visa_Inc._logo" fill-rule="nonzero">
<polygon id="polygon9" fill="#6f7886" points="433.352281 318.983808 352.341546 318.983808 403.011464 5.67909768 484.017769 5.67909768"></polygon>
<path d="M727.023395,13.3385039 C711.044518,6.99922669 685.700699,-0.0001150097 654.36314,-0.0001150097 C574.362437,-0.0001150097 518.026596,42.6604296 517.681059,103.652162 C517.016564,148.651727 558.015873,173.645579 588.680077,188.649864 C620.022066,203.981966 630.676128,213.989253 630.676128,227.655689 C630.35717,248.644854 605.350029,258.319893 582.026273,258.319893 C549.683112,258.319893 532.353097,253.331755 506.016966,241.654372 L495.349615,236.648514 L484.013339,306.978608 C503.013451,315.634756 538.019019,323.316312 574.362437,323.652989 C659.364569,323.652989 714.703668,281.652509 715.359302,216.65609 C715.68269,180.990457 694.03346,153.662015 647.359369,131.330571 C619.025325,116.99521 601.673159,107.329031 601.673159,92.6614232 C602.005406,79.3272342 616.349627,65.669658 648.333961,65.669658 C674.670091,65.0007336 694.02017,71.3311508 708.678918,77.6659981 L716.006077,80.9929003 L727.023395,13.3385039 L727.023395,13.3385039 L727.023395,13.3385039 Z" id="path11" fill="#6f7886"></path>
<path d="M834.693648,207.991082 C841.365173,189.992142 867.036809,120.330973 867.036809,120.330973 C866.700132,120.999897 873.695043,101.999785 877.6953,90.3356925 L883.356793,117.331888 C883.356793,117.331888 898.697755,192.326733 902.029087,207.991082 C889.368253,207.991082 850.694675,207.991082 834.693648,207.991082 L834.693648,207.991082 Z M934.691205,5.67909768 L872.029377,5.67909768 C852.705878,5.67909768 838.02498,11.3405905 829.68779,31.6741212 L709.356702,318.979378 L794.358834,318.979378 C794.358834,318.979378 808.353088,280.31023 811.361033,271.981899 C820.686105,271.981899 903.375796,271.981899 915.372136,271.981899 C917.697867,282.981498 925.038316,318.979378 925.038316,318.979378 L1000.04645,318.979378 L934.691205,5.67909768 L934.691205,5.67909768 L934.691205,5.67909768 Z" id="path13" fill="#6f7886"></path>
<path d="M284.67829,5.67909768 L205.34208,219.322928 L196.672643,175.993459 C182.005035,125.996895 136.004298,71.6766879 84.6698856,44.6672029 L157.339,318.651561 L243.005627,318.651561 L370.340486,5.67909768 L284.67829,5.67909768 L284.67829,5.67909768 L284.67829,5.67909768 Z" id="path15" fill="#6f7886"></path>
<path d="M131.671794,5.67909768 L1.33341981,5.67909768 L9.1820003e-07,12.009515 C101.672084,38.0089684 169.007523,100.679656 196.672643,176.006749 L168.338599,32.0152283 C163.673848,12.005085 149.338487,6.33916219 131.671794,5.67909768 L131.671794,5.67909768 Z" id="path17" fill="#838E9D"></path>
</g>
</g>
</svg>
</div>
</div>
@import url("https://fonts.googleapis.com/css2?family=Inconsolata&display=swap");
* {
margin: 0;
padding: 0;
}
body {
background: url("https://images.pexels.com/photos/1655166/pexels-photo-1655166.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260")
no-repeat center center;
background-size: cover;
display: grid;
font-family: "Inconsolata", monospace;
min-height: 100vh;
place-items: center;
}
.holder {
position: relative;
&:before,
&:after {
animation: orbit 5s linear infinite;
border-radius: 50%;
box-shadow: 0 0 1rem 0 rgba(0, 0, 0, 0.2);
content: "";
height: 150px;
position: absolute;
width: 150px;
}
&:before {
background: #ffe897;
background: -moz-radial-gradient(top right, #ffe897, #f98a05);
background: radial-gradient(to bottom left, #ffe897, #f98a05);
background: -webkit-radial-gradient(top right, #ffe897, #f98a05);
}
&:after {
animation-delay: -2.5s;
background: #e0e793;
background: -moz-radial-gradient(bottom right, #e0e793, #6dd0f1);
background: radial-gradient(to top left, #e0e793, #6dd0f1);
background: -webkit-radial-gradient(bottom right, #e0e793, #6dd0f1);
right: 0;
top: 0;
z-index: -1;
}
}
.card {
border: 1px solid #fff;
border-radius: 15px;
box-shadow: 0 0 1rem 0 rgba(0, 0, 0, 0.2);
font-size: 2rem;
height: 220px;
overflow: hidden;
position: relative;
width: 370px;
&:before {
background-color: rgba(255,255,255,0.3);
backdrop-filter: blur(10px) saturate(100%) contrast(45%) brightness(130%);
-webkit-backdrop-filter: blur(10px) saturate(100%) contrast(45%) brightness(130%);
content: "";
height: 100%;
position: absolute;
width: 100%;
}
&__text {
color: #6f7886;
margin-left: 30px;
margin-top: 100px;
position: relative;
z-index: 2;
}
svg {
bottom: 30px;
position: absolute;
right: 30px;
}
}
@keyframes orbit {
from {
transform: rotate(0deg) translateX(100px) rotate(0deg);
}
to {
transform: rotate(360deg) translateX(100px) rotate(-360deg);
}
}
Also see: Tab Triggers