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="min-h-screen bg-gray-300">
<div class="container mx-auto p-10 max-w-screen-lg">
<div class="bg-white rounded shadow p-8">
<!-- ToastBar -->
<div class="w-full bg-orange-200 text-yellow-900 px-4 py-2 flex items-center">
<img src="https://svgsilh.com/svg/151889.svg" class="w-10 block pr-2">
<div class="text-sm">Congrats you're eligible for a <b>Coupon Code</b> in this order </div>
</div>
<!-- Order Summary -->
<div>
<h3 class="text-xl mt-4 font-bold">Order Summary</h3>
<!-- BOX -->
<div class="border w-full rounded mt-5 flex p-4 justify-between items-center flex-wrap">
<img src="https://images-na.ssl-images-amazon.com/images/I/41KufN65f8L.jpg" class="w-12">
<div class="w-2/3">
<h3 class="text-lg font-medium">Black Jacket XL</h3>
<p class="text-gray-600 text-xs">Sold by <b>Aashir Khan</b></p>
<h4 class="text-red-700 text-xs font-bold mt-1">Only 2 left in stock</h4>
</div>
<div>
<h4 class="text-3xl font-medium"><sup class="text-lg text-purple-800">$</sup> 89</h4>
<h5 class="text-sm font-bold text-purple-800">60% OFF</h5>
</div>
<div class="w-full flex justify-between mt-4">
<button class="text-red-700 hover:bg-red-100 px-2">DELETE</button>
<label class="block uppercase tracking-wide text-gray-700" for="grid-first-name">
QTY
<select class="ml-3 text-sm bg-purple-700 border border-purple-200 text-white p-2 rounded leading-tight" id="grid-state">
<option>1</option>
<option>2</option>
</select>
</label>
</div>
</div>
<div class="border w-full rounded mt-5 flex p-4 justify-between items-center flex-wrap">
<img src="https://cdn11.bigcommerce.com/s-tboh32g/images/stencil/1280x1280/products/385314/492280/104C_BlackBlackHQ__07610.1557157866.jpg?c=2?imbypass=on" class="w-12">
<div class="w-2/3">
<h3 class="text-lg font-medium">Black Hat</h3>
<p class="text-gray-600 text-xs">Sold by <b>Taha Dildar</b></p>
<h4 class="text-red-700 text-xs font-bold mt-1">Only 1 left in stock</h4>
</div>
<div>
<h4 class="text-3xl font-medium"><sup class="text-lg text-purple-800">$</sup> 20</h4>
<h5 class="text-sm font-bold text-purple-800">40% OFF</h5>
</div>
<div class="w-full flex justify-between mt-4">
<button class="text-red-700 hover:bg-red-100 px-2">DELETE</button>
<label class="block uppercase tracking-wide text-gray-700" for="grid-first-name">
QTY
<select class="ml-3 text-sm bg-purple-700 border border-purple-200 text-white p-2 rounded leading-tight" id="grid-state">
<option>1</option>
<option>2</option>
</select>
</label>
</div>
</div>
</div>
<button class="px-4 py-4 bg-purple-700 text-white w-full mt-3 rounded shadow font-bold hover:bg-purple-900">PROCEED TO CHECKOUT SCREEN</button>
</div>
<div class="flex justify-between mt-8 flex-wrap lg:justify-center">
<div class="bg-white rounded shadow p-2 w-full lg:w-2/4">
<div class="w-full bg-orange-200 px-8 py-6">
<h3 class="text-2xl mt-4 font-bold">Price Breakdown</h3>
<div class="flex justify-between mt-3">
<div class="text-xl text-orange-900 font-bold">Amount</div>
<div class='text-xl text-right font-bold '>$102</div>
</div>
<div class="flex justify-between mt-3">
<div class="text-xl text-orange-900 font-bold">VAT (15%)</div>
<div class='text-xl text-right font-bold'>$12</div>
</div>
<div class="bg-orange-300 h-1 w-full mt-3"></div>
<div class="flex justify-between mt-3">
<div class="text-xl text-orange-900 font-bold">Total Amount</div>
<div class="text-2xl text-orange-900 font-bold">$114</div>
</div>
<button class="px-4 py-4 bg-purple-700 text-white w-full mt-3 rounded shadow font-bold hover:bg-purple- 900"> CHECKOUT</button>
</div>
</div>
<div class="bg-white rounded shadow px-10 py-6 w-full mt-4 flex flex-wrap justify-center lg:w-2/4 lg:ml-3">
<div class="pr-8">
<h3 class="text-2xl mt-4 font-bold text-purple-900">Thank You, Alex</h3>
<h4 class="text-sm text-gray-600 font-bold">ORDER #5624</h4>
</div>
<img src="https://image.flaticon.com/icons/svg/1611/1611768.svg" alt="" class="w-24">
</div>
</div>
</div>
</div>
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&display=swap');
body {
font-family: 'Manrope', 'sans-serif';
}
// My Youtube Channel: https://www.youtube.com/channel/UC3zXkVhnaJfBigCsP6d0QSQ
Also see: Tab Triggers