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="background">
<div class="whole-menu">
<header class="header">
<div class="logo quick-logo">QUICK</div>
<div class="logo eats-logo">EATS</div>
</header>
<div class="container bar-container hotdog-menu">
<h2 class="bar-title-hotdog">Hot Dogs</h2>
<div class="items right-spacer">
<p><span>Hot Dog</span> <span class="price">3.00</span></p>
<p><span>Chilli Dog</span> <span class="price">5.00</span></p>
<p><span>Veggie Hot Dog</span> <span class="price">3.00</span></p>
</div>
</div>
<div class="container bar-container burger-menu">
<h2 class="bar-title-burgurs">Burgers</h2>
<div class="items left-spacer">
<p><span>Hamburger</span>
<span class="price">3.00</span>
</p>
<p><span>Cheeseburger</span>
<span class="price">3.50</span>
</p>
<p><span>Double Cheese</span>
<span class="price">4.50</span>
</p>
<p><span>Veggie Burger</span>
<span class="price">3.00</span>
</p>
</div>
</div>
<div class="container right-spacer filled-container sides-menu">
<h2 class="round-titles" id="sides">Glorious<br>Sides</h2>
<div class="items filled-items">
<p><span>Chips</span> <span class="price">1.00</span></p>
<p><span>Fries</span> <span class="price">2.00</span></p>
<p><span>Sweet Potato Fries</span> <span class="price">3.00</span></p>
<p><span>Onion Rings</span> <span class="price">3.00</span></p>
<p><span>Cheese sticks</span> <span class="price">3.00</span></p>
<p><span>Jalepeno poppers</span> <span class="price">2.00</span></p>
</div>
</div>
<div class="container left-spacer outline-container chili-menu">
<h2 class="round-titles thin-titles">Chili</h2>
<div class="items">
<p><span>Cup</span> <span class="price">2.00</span></p>
<p><span>Bowl</span> <span class="price">4.00</span></p>
</div>
</div>
<div class="container right-spacer outline-container drinks-menu">
<div class="items">
<p><span>20oz</span> <span class="price">1.50</span></p>
<p><span>32oz</span> <span class="price">2.00</span></p>
</div>
<h2 class="thin-titles" id="opposite-round">Drinks</h2>
</div>
<div class="combo-container">
<p class="combo">COMBO</p>
<p class="combo-description">Includes a hamburger, veggie burger or a regular hot dog with any side and a drink.</p>
</div>
<div class="price-sticker">$5
</div>
</div>
</div>
<img src="https://assets.codepen.io/1026437/jlSqLogo.png" alt="jl-logo">
@import url("https://fonts.googleapis.com/css2?family=Noto+Sans&family=Oswald:wght@400;500&display=swap");
img {
height: 3rem;
position: fixed;
bottom: 0;
right: 0;
opacity: 40%;
}
* {
margin: 0;
}
body {
background: #c2f2ec;
display: flex;
height: 100vh;
margin: 0;
}
.background {
background: #e5fff3;
border-radius: 1rem;
margin: auto;
transform: rotate(10deg);
}
.whole-menu {
align-items: center;
border-radius: 1rem;
background: #c1ffd8;
display: grid;
gap: 0.8rem;
grid-template-columns: repeat(2, 1fr);
grid-template-rows: 24% 33% auto 18%;
height: 32.7rem;
transform: rotate(-10deg);
width: 25rem;
}
.header {
align-items: center;
background: #4b7b81;
border-radius: 1rem 0 0.65rem 0;
display: grid;
height: 100%;
justify-items: end;
width: 100%;
}
.logo {
font-family: "Oswald", sans-serif;
font-size: 3.125rem;
font-weight: 400;
letter-spacing: 0.4375rem;
}
.quick-logo {
color: #ffd370;
line-height: 0.9;
padding: 10px 0px 2px 0;
}
.eats-logo {
background: #ff9b9c;
bottom: 0.625rem;
border-radius: 1rem 0 0 1rem;
color: #4b7b81;
font-weight: 500;
line-height: 1.05;
padding: 0 0 0.3rem 0.875rem;
position: relative;
}
.hotdog-menu {
align-self: end;
}
.items {
color: #6a696a;
font-family: "Noto Sans", sans-serif;
font-size: 0.8125rem;
line-height: 1.7;
margin: 0;
padding: 0.5rem;
}
.left-spacer {
margin-left: 1rem;
}
.right-spacer {
margin-right: 1rem;
}
h2 {
background: #4b7b81;
color: #ffd370;
font-family: "Oswald", sans-serif;
font-size: 1rem;
font-weight: 400;
letter-spacing: 0.1rem;
margin: 0;
padding: 0.13rem 0.5rem 0 0;
text-align: end;
text-transform: uppercase;
}
.bar-title-hotdog {
border-radius: 1rem 0 0 1rem;
padding-right: 1.5em;
}
.bar-title-burgurs {
border-radius: 0 1rem 1rem 0;
}
.price {
float: right;
}
#sides {
background: #ff9b9c;
color: #4b7b81;
}
.sides-menu {
align-self: start;
background: #ff9b9c;
border-radius: 1rem;
}
.filled-items {
color: #6a696a;
font-size: 11px;
padding: 5px 12px 12px 12px;
}
.round-titles {
border-radius: 0.7rem 0.7rem 0 0;
}
#opposite-round {
border-radius: 0 0 0.7rem 0.7rem;
}
.outline-container {
border: 0.125rem solid #4b7b81;
border-radius: 1.1rem;
}
.combo-container {
align-items: center;
align-self: start;
background: #ff9b9c;
border-radius: 0 1rem 1rem 0;
display: grid;
grid-column: 1 / span 2;
grid-template-columns: 12.5rem auto;
height: 85%;
margin-right: 1rem;
padding-right: 0.8rem;
}
.combo {
color: #4b7b81;
font-family: "Oswald", sans-serif;
font-size: 2.5rem;
font-weight: 400;
letter-spacing: 0.4375rem;
text-align: end;
}
.combo-description {
color: #6a696a;
font-size: 0.75em;
font-family: "Noto Sans", sans-serif;
line-height: 1.3;
padding: 0 2em 0 1em;
text-align: center;
}
.price-sticker {
background: #fed370;
border-radius: 50%;
bottom: 3.5rem;
color: #4b7b81;
font-family: "chalkduster";
font-size: 1.5rem;
height: 3rem;
line-height: 3rem;
position: absolute;
right: 0.1875rem;
transform: rotate(25deg);
text-align: center;
width: 3rem;
}
/* colors ---
dark green : #4b7b81
dark grey for text : #6a696a
yellow : #ffd370
red : #ff9b9c
*/
Also see: Tab Triggers