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.
<br>
<ul class="accordion">
<li>
<a class="toggle" href="javascript:void(0);"> Domain 1: Host Country Economy and Aid Dependency </a>
<ul class="inner">
<li>
<a href ="#" class="toggle" style="background-color: #012e67">
Net Official Development Assistance Received (ODA)</a>
<ul class="inner">
<li>
<p>Source: World Bank, World Development Indicators</p>
<a href="#" class="toggle" style="background-color: green">Click to view Global Availability of Scores</a>
<div class="inner">
<br>
Global Availability of Scores: 264 Countries
</p>
</div>
</li>
</ul>
</li>
<li> <a href="#" class="toggle" style="background-color:#012e67 ">GDP per Capita</a>
<ul class="inner">
<li>
<p>Source: World Bank, World Development Indicators</p>
<a href="#" class="toggle" style="background-color: green">Click to view Global Availability of Scores</a>
<div class="inner">
<p>
264 Countries
</p>
</div></li>
</ul>
<li> <a href="#" class="toggle" style="background-color: #012e67">GNI per Capita</a>
<ul class="inner">
<li>
<p>Source: World Bank, World Development Indicators</p>
<a href="#" class="toggle" style="background-color: green">Click to view Global Availability of Scores</a>
<div class="inner">
<p>
264 Countries
</p>
</div></li>
</ul>
<li>
<li>
<a href="#" class="toggle" style="background-color: #012e67">Global Competetiveness Index</a>
<ul class="inner">
<li>
<p>Source: The World Economic Forum</p>
<a href="#" class="toggle" style="background-color: green">Click to view Global Availability of Scores</a>
<div class="inner">
<p>
144 Countries
</p>
</div>
</ul>
</li>
</ul>
<li>
<a class="toggle" href="javascript:void(0);">Domain 2: Governance</a>
<ul class="inner">
<li>
<a href ="#" class="toggle" style="background-color: #2f4c58">
Fragile State Index</a>
<ul class="inner">
<li>
<p>Source: Fund for Peace</p>
<a href="#" class="toggle" style="background-color: green">Click to view Global Availability of Scores</a>
<div class="inner">
<br>
Global Availability of Scores: 178 Countries
</p>
</div>
</li>
</ul>
</li>
<li> <a href="#" class="toggle" style="background-color:#2f4c58 ">Political Stability Index</a>
<ul class="inner">
<li>
<p>Source: World Bank, Worldwide</p>
<a href="#" class="toggle" style="background-color: green">Click to view Global Availability of Scores</a>
<div class="inner">
<p>
195 Countries
</p>
</div></li>
</ul>
<li> <a href="#" class="toggle" style="background-color: #2f4c58">Corruption Perception Index</a>
<ul class="inner">
<li>
<p>Source: Transparency International, Corruption Perceptions</p>
<a href="#" class="toggle" style="background-color: green">Click to view Global Availability of Scores</a>
<div class="inner">
<p>
180 Countries
</p>
</div></li>
</ul>
<li>
<li>
<a href="#" class="toggle" style="background-color: #2f4c58">Rule of Law: Open Governments</a>
<ul class="inner">
<li>
<p>Source: World Justice Project, Rule of Law Index</p>
<a href="#" class="toggle" style="background-color: green">Click to view Global Availability of Scores</a>
<div class="inner">
<p>
128 Countries
</p>
</div>
</ul>
</li>
<li> <a href="#" class="toggle" style="background-color:#2f4c58 ">Political Corruption</a>
<ul class="inner">
<li>
<p>Source: Varieties of Democracy, V-Dem Data</p>
<a href="#" class="toggle" style="background-color: green">Click to view Global Availability of Scores</a>
<div class="inner">
<p>
172 Countries
</p>
</div></li>
</ul>
<li> <a href="#" class="toggle" style="background-color:#2f4c58 ">Government Effectiveness</a>
<ul class="inner">
<li>
<p>Source: World Bank, Worldwide Governance Indicators</p>
<a href="#" class="toggle" style="background-color: green">Click to view Global Availability of Scores</a>
<div class="inner">
<p>
185 Countries
</p>
</div></li>
</ul>
<li> <a href="#" class="toggle" style="background-color:#2f4c58 ">Migration Governance Indicator</a>
<ul class="inner">
<li>
<p>Source: International Organization for Migration</p>
<a href="#" class="toggle" style="background-color: green">Click to view Global Availability of Scores</a>
<div class="inner">
<p>
84 Countries
</p>
</div></li>
</ul>
<li> <a href="#" class="toggle" style="background-color:#2f4c58 ">The Commitment to Reducing Inequality (CRI) Index</a>
<ul class="inner">
<li>
<p>Source: OXFAM, Development Finance International</p>
<a href="#" class="toggle" style="background-color: green">Click to view Global Availability of Scores</a>
<div class="inner">
<p>
158 Countries
</p>
</div></li>
</ul>
</ul> <!--insert here ^^-->
<li>
<a class="toggle" href="javascript:void(0);">Domain 3: KPMG Change Readiness Index </a>
<ul class="inner">
<li>
<a href ="#" class="toggle" style="background-color: #6e93d6">
KPMG Change Readiness Index</a>
<ul class="inner">
<li>
<p>Source: KPMG Global</p>
<a href="#" class="toggle" style="background-color: green">Click to view Global Availability of Scores</a>
<div class="inner">
<br>
Global Availability of Scores: 140 Countries
</p>
</div>
</li>
</ul>
</li>
<li> <a href="#" class="toggle" style="background-color:#6e93d6 ">Civil Society Organization Sustainability Index</a>
<ul class="inner">
<li>
<p>Source: USAID</p>
<a href="#" class="toggle" style="background-color: green">Click to view Global Availability of Scores</a>
<div class="inner">
<p>
71 Countries
</p>
</div></li>
</ul>
<li> <a href="#" class="toggle" style="background-color: #6e93d6">Varieties of Democracy/ Women Political Empowerment Sub-index</a>
<ul class="inner">
<li>
<p>Source: Varieties of Democracy, V-Dem Data</p>
<a href="#" class="toggle" style="background-color: green">Click to view Global Availability of Scores</a>
<div class="inner">
<p>
202 Countries
</p>
</div></li>
</ul>
<li>
<li>
<a href="#" class="toggle" style="background-color: #6e93d6">Geographies of Organizations</a>
<ul class="inner">
<li>
<p>Source: NGOAIDMap (INTERACTION)</p>
<a href="#" class="toggle" style="background-color: green">Click to view Global Availability of Scores</a>
<div class="inner">
<p>
Varied
</p>
</div>
</ul>
</li>
</ul>
<li>
<li>
<li>
<a class="toggle" href="javascript:void(0);">Domain 4: Social Cohesion in the Host Country </a>
<ul class="inner">
<li>
<a href ="#" class="toggle" style="background-color: #007FFF">
The Overall Human Development Index (HDI)</a>
<ul class="inner">
<li>
<p>Source: HDR Reports</p>
<a href="#" class="toggle" style="background-color: green">Click to view Global Availability of Scores</a>
<div class="inner">
<br>
Global Availability of Scores: 189 Countries
</p>
</div>
</li>
</ul>
</li>
<li> <a href="#" class="toggle" style="background-color:#007FFF ">HDI/ Gender Inequality Index (GII) Sub-Index</a>
<ul class="inner">
<li>
<p>Source: HDR Reports</p>
<a href="#" class="toggle" style="background-color: green">Click to view Global Availability of Scores</a>
<div class="inner">
<p>
189 Countries
</p>
</div></li>
</ul>
<li> <a href="#" class="toggle" style="background-color: #007FFF">HDI/ Multidimensional Poverty Index (MPI) Sub-index</a>
<ul class="inner">
<li>
<p>Source: HDR Reports</p>
<a href="#" class="toggle" style="background-color: green">Click to view Global Availability of Scores</a>
<div class="inner">
<p>
189 Countries
</p>
</div></li>
</ul>
<li>
<li>
<a href="#" class="toggle" style="background-color: #007FFF">GINI Index</a>
<ul class="inner">
<li>
<p>Source: World Bank, Worldwide Governance Indicators</p>
<a href="#" class="toggle" style="background-color: green">Click to view Global Availability of Scores</a>
<div class="inner">
<p>
82 Countries
</p>
</div>
</ul>
</li>
<li> <a href="#" class="toggle" style="background-color: #007FFF">Social Progress Index (SPI)</a>
<ul class="inner">
<li>
<p>Source: Social Progress Imperative</p>
<a href="#" class="toggle" style="background-color: green">Click to view Global Availability of Scores</a>
<div class="inner">
<p>
163 Countries
</p>
</div></li>
</ul>
<li>
</ul>
<li>
@import url('https://fonts.googleapis.com/css?family=Pacifico|Open+Sans:300,400,600');
* {
box-sizing: border-box;
font-family: 'Open Sans',sans-serif;
font-weight: 300;
}
a {
text-decoration: none;
text-align: center;
color: inherit;
}
p {
font-size:1.1em;
margin: 1em 0;
}
.description {
margin: 1em auto 2.25em;
}
body {
width: 100%;
min-width: 300px;
max-width: 95%;
margin: 1.5em auto;
color: #333;
}
h1 {
font-family: 'Pacifico', cursive;
font-weight: 400;
font-size: 2.5em;
}
ul {
list-style: none;
padding: 0;
.inner {
padding-left: 1em;
overflow: hidden;
display: none;
&.show {
/*display: block;*/
}
}
li {
margin: .5em 0;
a.toggle {
width: 100%;
display: block;
background: rgba(0,0,0,0.78);
color: #fefefe;
padding: .75em;
border-radius: 0.15em;
transition: background .3s ease;
&:hover {
background: rgba(0, 0, 0, 0.9);
}
}
}
}
$('.toggle').click(function(e) {
e.preventDefault();
var $this = $(this);
if ($this.next().hasClass('show')) {
$this.next().removeClass('show');
$this.next().slideUp(350);
} else {
$this.parent().parent().find('li .inner').removeClass('show');
$this.parent().parent().find('li .inner').slideUp(350);
$this.next().toggleClass('show');
$this.next().slideToggle(350);
}
});
Also see: Tab Triggers