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="container">
<div class="row">
<div class="col-md-12">
<h1>Collapsible tabs (Bootstrap accordion) easy to use plugin</h1><hr>
</div>
<div class="col-md-12">
<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
<div class="panel panel-default">
<div class="panel-heading" role="tab" id="headingOne">
<h4 class="panel-title">
<a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
Vegetables calories chart
</a>
</h4>
</div>
<div id="collapseOne" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingOne">
<div class="panel-body">
<p>No doubt about it, vegetables should be a regular part of everyone’s diet. One glance at this calorie chart, and it’s easy to see why. A large portion of vegetables won’t contain very many calories, and yet it will include a wonderful dose of vitamins, minerals, and other nutrients. Vegetables contain a mix of carbohydrates along with smaller amounts of healthy fats and protein.</p>
<table class="table table-striped">
<thead>
<tr>
<th>#</th>
<th>Vegetable</th>
<th>Serving</th>
<th>Calories</th>
<th>Kilojoule</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">#VEG1201</th>
<td>Artichoke</td>
<td>1 artichoke (128g)</td>
<td>60 cal</td>
<td>252 kJ</td>
</tr>
<tr>
<th scope="row">#VEG1202</th>
<td>Broccoli</td>
<td>1 bunch (608g)</td>
<td>207 cal</td>
<td>869 kJ</td>
</tr>
<tr>
<th scope="row">#VEG1203</th>
<td>Potato</td>
<td>1 potato (213g)</td>
<td>164 cal</td>
<td>688 kJ</td>
</tr>
<tr>
<th scope="row">#VEG1204</th>
<td>Gourd</td>
<td>1 gourd (771g)</td>
<td>108 cal</td>
<td>455 kJ</td>
</tr>
<tr>
<th scope="row">#VEG1205</th>
<td>Cucumber</td>
<td>1 Cucumber (410g)</td>
<td>66 cal</td>
<td>275 kJ</td>
</tr>
<tr>
<th scope="row">#VEG1206</th>
<td>Mushrooms</td>
<td>1 mushroom (5.4g)</td>
<td>1 cal</td>
<td>5 kJ</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading" role="tab" id="headingTwo">
<h4 class="panel-title">
<a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
Fruits calories chart
</a>
</h4>
</div>
<div id="collapseTwo" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingTwo">
<div class="panel-body">
<p>All fruits are mostly made of carbohydrates, although calories in fruit can also come from fats and small amounts of protein. The carbs, however, are not all the same and are usually a mix of complex carbohydrates (i.e., made of three or more bonded sugars) and simple carbohydrates (i.e., simple sugars).</p>
<table class="table table-striped">
<thead>
<tr>
<th>#</th>
<th>Fruit</th>
<th>Serving</th>
<th>Calories</th>
<th>Kilojoule</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">#FRU1201</th>
<td>Pineapple</td>
<td>1 pineapple (905g)</td>
<td>453 cal</td>
<td>1901 kJ</td>
</tr>
<tr>
<th scope="row">#FRU1202</th>
<td>Raisins</td>
<td>1 cup (145g)</td>
<td>434 cal</td>
<td>1821 kJ</td>
</tr>
<tr>
<th scope="row">#FRU1203</th>
<td>Pomegranate</td>
<td>1 pomegranate (283g)</td>
<td>234 cal</td>
<td>984 kJ</td>
</tr>
<tr>
<th scope="row">#FRU1204</th>
<td>Mango</td>
<td>1 mango (336g)</td>
<td>201 cal</td>
<td>849 kJ</td>
</tr>
<tr>
<th scope="row">#FRU1205</th>
<td>Grapes</td>
<td>1 cup (151g)</td>
<td>107 cal</td>
<td>439 kJ</td>
</tr>
<tr>
<th scope="row">#FRU1206</th>
<td>Apricot</td>
<td>1 apricot (35g)</td>
<td>17 cal</td>
<td>71 kJ</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading" role="tab" id="headingThree">
<h4 class="panel-title">
<a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseThree" aria-expanded="false" aria-controls="collapseThree">
Nuts and seeds calories chart
</a>
</h4>
</div>
<div id="collapseThree" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingThree">
<div class="panel-body">
<p>Nuts and seeds contain a high amount of calories considering they are such small foods and are consumed in small portions. Most ingredients in this category are primarily composed of fats, along with varying degrees of protein and carbohydrates. Tree nuts like almonds and edible seeds like from the chia plant are among the best whole food sources of omega-3 fats. </p>
<table class="table table-striped">
<thead>
<tr>
<th>#</th>
<th>Nuts/Seeds</th>
<th>Serving</th>
<th>Calories</th>
<th>Kilojoule</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">#NAS1201</th>
<td>Coconut</td>
<td>1 coconut (397g)</td>
<td>1405 cal</td>
<td>5903 kJ</td>
</tr>
<tr>
<th scope="row">#NAS1202</th>
<td>Pine Nuts</td>
<td>1 cup (146g)</td>
<td>828 cal</td>
<td>3476 kJ</td>
</tr>
<tr>
<th scope="row">#NAS1203</th>
<td>Almonds</td>
<td>1 cup (95g)</td>
<td>546 cal</td>
<td>2294 kJ</td>
</tr>
<tr>
<th scope="row">#NAS1204</th>
<td>Cashew</td>
<td>1 oz. (28.35g)</td>
<td>155 cal</td>
<td>652 kJ</td>
</tr>
<tr>
<th scope="row">#NAS1205</th>
<td>Poppy Seeds</td>
<td>1 spoon (30g)</td>
<td>42 cal</td>
<td>179 kJ</td>
</tr>
<tr>
<th scope="row">#NAS1206</th>
<td>Radish Seeds</td>
<td>1 cup (38g)</td>
<td>16 cal</td>
<td>69 kJ</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-12">
<p style="font-style: italic; color: #2196f3; font-size: 18px; text-align: center; margin-top: 50px; margin-bottom: 20px;">Follow me on Twitter: <a href="https://twitter.com/mrdogra007/" target="_blank">@mrdogra007</a></p>
</div>
</div>
</div>
h1 { font-size: 26px; text-align: center; margin-top: 40px; margin-bottom: 20px;}
.panel-default>.panel-heading { /* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#2340ff+1,7c21f5+100 */
background: #2340ff; /* Old browsers */
background: -moz-linear-gradient(-45deg, #2340ff 1%, #7c21f5 100%); /* FF3.6-15 */
background: -webkit-linear-gradient(-45deg, #2340ff 1%,#7c21f5 100%); /* Chrome10-25,Safari5.1-6 */
background: linear-gradient(135deg, #2340ff 1%,#7c21f5 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#2340ff', endColorstr='#7c21f5',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */
color: #ffffff; padding: 18px;}
.panel { box-shadow: 0px 0px 60px 0px rgba( 0, 0, 0, .40 );}
.panel-group .panel { margin-bottom: 20px; border: 1px solid #2340ff;
/* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#2340ff+1,7c21f5+100 */
border-color: #2340ff; /* Old browsers */
border-color: -moz-linear-gradient(-45deg, #2340ff 1%, #7c21f5 100%); /* FF3.6-15 */
border-color: -webkit-linear-gradient(-45deg, #2340ff 1%,#7c21f5 100%); /* Chrome10-25,Safari5.1-6 */
border-color: linear-gradient(135deg, #2340ff 1%,#7c21f5 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#2340ff', endColorstr='#7c21f5',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */}
.panel-title { font-size: 18px;}
.panel-title a, .panel-title a:hover, .panel-title a:focus { text-decoration: none;}
.panel-body p { font-size: 16px;}
// Collapsible tabs (Bootstrap accordion)
// Deigned by Nishant Dogra
// Date: 07/12/2017
// Twitter: @mrdogra007
// Blog: https://t.co/F6RF2rCHu3
Also see: Tab Triggers