Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

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.

+ add another resource

Packages

Add Packages

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.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                
<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>
              
            
!

CSS

              
                @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);
              
            
            }
        }
    }
}
              
            
!

JS

              
                $('.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);
    }
});
              
            
!
999px

Console