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.
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<body ng-app="JapaneseMenu">
<div class="header">
<h1><span>Japanese</span><span>Menu</span></h1>
</div>
<div class="main" ng-controller="MainController">
<div class="container">
<h1>Specials for {{ today | date}}</h1>
<h2>Appetizers</h2>
<div class="appetizers row" ng-repeat="appetizer in appetizers">
<div class="item-image col-md-3">
<img src="{{appetizer.url}}">
</div>
<div class="item col-md-6">
<h3 class="name">{{appetizer.name}} </h3>
<p class="description">{{appetizer.description}} </p>
</div>
<div class="price col-md-3">
<p class="price">{{appetizer.price | currency}} </p>
</div>
</div>
<h2>Entrees</h2>
<div class="ramens row" ng-repeat="ramen in ramens">
<div class="item-image col-md-3">
<img src="{{ramen.url}}">
</div>
<div class="item col-md-6">
<h3 class="name">{{ramen.name}}</h3>
<p class="description">{{ramen.description}}</p>
</div>
<div class="price col-md-3">
<p class="price">{{ramen.price | currency}} </p>
</div>
</div>
<h2>Sides</h2>
<div class="sushis row" ng-repeat="sushi in sushis">
<div class="item-image col-md-3">
<img src="{{sushi.url}}">
</div>
<div class="item col-md-6">
<h3 class="name">{{sushi.name}}</h3>
<p class="description">{{sushi.description}}</p>
</div>
<div class="price col-md-3">
<p class="price">{{sushi.price | currency}} </p>
</div>
</div>
</div>
</div>
<div class="footer">
</div>
</body>
@import url('https://fonts.googleapis.com/css?family=Exo:700&display=swap');
body,
html {
background: url(https://www.toptal.com/designers/subtlepatterns/patterns/rockywall.png);
background-repeat: repeat;
font-family: 'Exo', sans-serif;
}
body p {
font-style: italic;
font-size: 16px;
}
.header h1 {
background: #ce2c38;
border-radius: 0%;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
height: 120px;
margin: 60px auto 0;
position: relative;
text-align: center;
width: 500px;
z-index: 10;
}
.header h1 span {
color: #fff;
display: block;
font-size: 40px;
padding: 20px 0 0 0;
}
.header h1 span+span {
color: #000;
display: block;
font-size: 28px;
padding: 0;
}
.main .container {
background: #fff;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
margin: -70px auto 80px;
padding: 80px;
z-index: 0;
}
.row {
margin:3% 0%;
}
h1 {
color: #444;
font-family: 'Oswald', sans-serif;
font-size: 16px;
margin: 20px 0 0 0;
text-align: center;
text-transform: uppercase;
}
h2 {
border-bottom: 1px solid #444;
color: #000;
font-family: 'Oswald', sans-serif;
margin: 20px 0 10px;
padding: 0 0 10px 0;
text-transform: uppercase;
}
h3 {
color: #ce2c38;
font-family: 'Oswald', sans-serif;
margin: 10px 0 5px;
text-transform: uppercase;
}
/*.item h3:after {
content: "\f030";
font-family: FontAwesome;
font-size: 15px;
margin-top: 9px;
margin-left: 7px;
position: absolute;
}*/
.item-image img {
width: 100%;
max-width: 400px;
height: auto;
border: 4px solid #ce2c38;
border-radius: 20px;
}
.item h3 {
width:fit-content;
}
.item i {
float: right;
margin-left: 10px;
font-size: 18px;
position: absolute;
margin-top: 8px;
}
.price p {
font-family: 'Oswald', sans-serif;
font-size: 20px;
font-style: normal;
margin: 26px 0 5px;
text-align: right;
}
var app = angular.module("JapaneseMenu", []);
app.controller('MainController', ['$scope', function($scope) {
$scope.today = new Date();
$scope.appetizers = [{
name: 'Edamame',
description: 'Steamed Edamame served with soy sauce',
price: 4.00,
url: 'https://upload.wikimedia.org/wikipedia/commons/e/e7/Edamame_by_Zesmerelda_in_Chicago.jpg'
}, {
name: 'Chicken Kaarage',
description: 'Deep fried chicken with sweet and spicy sauce',
price: 9.95,
url: 'https://static01.nyt.com/images/2018/07/25/dining/HK-karaage-horizontal/merlin_141075300_74569dec-9fc2-4174-931d-019dddef3bb8-articleLarge.jpg'
}, {
name: 'Vegetable Tempura',
description: 'Various vegetables lightly fried and served with soy sauce.',
price: 6.99,
url: 'https://static01.nyt.com/images/2013/10/23/dining/23JPFLEX1/23JPFLEX1-articleLarge.jpg'
}];
$scope.ramens = [{
name: 'Tonkotsu',
description: '2 pieces chashu (house-made pork shoulder), chopped green onion, cloud ear mushrooms, sesame seeds and seaweed.',
price: 9.80,
url: 'https://s3-media0.fl.yelpcdn.com/bphoto/o0CQt_Ki3SKPsGRjQDgrNA/o.jpg'
}, {
name: 'Kuro Ma-Yu',
description: 'Original pork bone broth seasoned with flame-roasted garlic oil. Topped with 2 pieces of chashu, bean sprouts, green onion, cloud ear mushrooms and sesame seeds.',
price: 11.00,
url: 'https://s3-media0.fl.yelpcdn.com/bphoto/uAjnEkHY59MbfnxZ-ZhERA/o.jpg'
}, {
name: 'Veggie Ramen',
description: 'Flame roasted tomato and soy milk based soup with spinach noodles and a dash of pesto. Topped with 2 pieces tofu with broccoli, paprika and micro greens.',
price: 12.00,
url: 'https://s3-media0.fl.yelpcdn.com/bphoto/SeIsf52urxyFGa5xw2dlLg/o.jpg'
}];
$scope.sushis = [{
name: 'Rainbow Roll',
description: 'California roll, smelt egg, assorted fish',
price: 13.99,
url: 'https://i.ytimg.com/vi/I-W3jLmaMRw/maxresdefault.jpg'
}, {
name: 'Y2K Roll',
description: 'Crab meat and avocado inside. Salmon on top.',
price: 13.99,
url: 'https://www.gannett-cdn.com/-mm-/8886fbfc43984dda399761692836a2e661a3e2bc/c=0-73-1406-864/local/-/media/2016/08/19/Camarillo/wp-PVCS-focus805-962-Y2K.jpg'
}, {
name: 'Spider Roll',
description: 'Lightly fried soft shell crab, avocado, green salad & gobo',
price: 12.99,
url: 'https://i.ytimg.com/vi/DiaY-TPvDWE/maxresdefault.jpg'
}];
}]);
Also see: Tab Triggers