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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

              
                <input type="radio" id="animal" name="wiki" value="Animal" checked>
<input type="radio" id="plant" name="wiki" value="Plant">
<input type="radio" id="space" name="wiki" value="Space">
<input type="radio" id="river" name="wiki" value="River">

<ul class="accordion">
  <li data-radio="animal">
    <label for="animal" class="accordion-title">
      <span>01</span>
      <span class="accordion-heading">Animal</span>
    </label>
    <div class="accordion-content">Animals are multicellular eukaryotic organisms that form the biological kingdom Animalia. With few exceptions, animals consume organic material, breathe oxygen, are able to move, can reproduce sexually, and grow from a hollow sphere of cells, the blastula, during embryonic development. Over 1.5 million living animal species have been described—of which around 1 million are insects—but it has been estimated there are over 7 million animal species in total. Animals range in length from 8.5 millionths of a metre to 33.6 metres (110 ft). They have complex interactions with each other and their environments, forming intricate food webs. The kingdom Animalia includes humans, but in colloquial use the term animal often refers only to non-human animals. The study of non-human animals is known as zoology.</div>
  </li>
  <li data-radio="plant">
    <label for="plant" class="accordion-title">
      <span>02</span>
      <span class="accordion-heading">Plant</span>
    </label>
    <div class="accordion-content">MPlants are mainly multicellular, predominantly photosynthetic eukaryotes of the kingdom Plantae. Historically, plants were treated as one of two kingdoms including all living things that were not animals, and all algae and fungi were treated as plants. However, all current definitions of Plantae exclude the fungi and some algae, as well as the prokaryotes (the archaea and bacteria). By one definition, plants form the clade Viridiplantae (Latin name for "green plants"), a group that includes the flowering plants, conifers and other gymnosperms, ferns and their allies, hornworts, liverworts, mosses and the green algae, but excludes the red and brown algae.</div>
  </li>
  <li data-radio="space">
    <label for="space" class="accordion-title">
      <span>03</span>
      <span class="accordion-heading">Space</span>
    </label>
    <div class="accordion-content">Space is the boundless three-dimensional extent in which objects and events have relative position and direction. Physical space is often conceived in three linear dimensions, although modern physicists usually consider it, with time, to be part of a boundless four-dimensional continuum known as spacetime. The concept of space is considered to be of fundamental importance to an understanding of the physical universe. However, disagreement continues between philosophers over whether it is itself an entity, a relationship between entities, or part of a conceptual framework.</div>
  </li>
  <li data-radio="river">
    <label for="river" class="accordion-title">
      <span>04</span>
      <span class="accordion-heading">River</span>
    </label>
    <div class="accordion-content">A river is a natural flowing watercourse, usually freshwater, flowing towards an ocean, sea, lake or another river. In some cases a river flows into the ground and becomes dry at the end of its course without reaching another body of water. Small rivers can be referred to using names such as stream, creek, brook, rivulet, and rill. There are no official definitions for the generic term river as applied to geographic features, although in some countries or communities a stream is defined by its size. Many names for small rivers are specific to geographic location; examples are "run" in some parts of the United States, "burn" in Scotland and northeast England, and "beck" in northern England. Sometimes a river is defined as being larger than a creek, but not always: the language is vague.</div>
  </li>
</ul>
 
<footer class="page-footer">
  <small>Made with <span>❤</span> by <a href="http://georgemartsoukos.com/" target="_blank">George Martsoukos</a>
  </small>
</footer>
              
            
!

CSS

              
                /* RESET RULES
–––––––––––––––––––––––––––––––––––––––––––––––––– */
:root {
  --accordion-color: #282828;
  --title-color: #191919;
  --active-color: #3e86d2;
  --separator-color: #292c2d;
  --white: #9b9b9b;
  --red: #e74c3c;
  --black: #000;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

label {
  cursor: pointer;
}

ul {
  list-style: none;
}

a {
  text-decoration: none;
  color: inherit;
}

input[type="radio"] {
  position: absolute;
  left: -9999px;
}

body {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 100vh;
  padding: 50px 0;
  font: 1rem/1.5 'Muli', sans-serif;
}


/* ACCORDION
–––––––––––––––––––––––––––––––––––––––––––––––––– */
.accordion {
  position: relative;
  width: calc(100% - 20px);
  max-width: 800px;
  min-height: 380px;
  margin: 0 auto;
  background: var(--accordion-color);
  color: var(--white);
}

.accordion::before {
  content: 'Source: Wikipedia';
  position: absolute;
  right: 0;
  top: -20px;
  font-size: 0.8rem;
  color: var(--black);
}

.accordion label {
  text-align: center;
}

.accordion,
.accordion li,
.accordion .accordion-title {
  display: flex;
}

.accordion li:not(:last-child) {
  border: 1px solid var(--separator-color);
}

.accordion .accordion-title {
  flex-direction: column;
  justify-content: space-between;
  width: 70px;
  font-size: 1.4rem;
  font-weight: bold;
  line-height: normal;
  padding: 20px 10px;
  background: var(--title-color);
  transition: color 0.1s;
}

.accordion .accordion-title:hover {
  color: var(--active-color);
}

.accordion .accordion-heading {
  display: inline-block;
  white-space: nowrap;
  transform-origin: bottom;
  transform: rotate(-90deg) translate(50%, 50%);
}

.accordion .accordion-content {
  display: none;
  align-items: center;
  justify-content: center;
  flex-grow: 1;
  padding: 20px;
}

[value="Animal"]:checked ~ .accordion [data-radio="animal"],
[value="Plant"]:checked ~ .accordion [data-radio="plant"],
[value="Space"]:checked ~ .accordion [data-radio="space"],
[value="River"]:checked ~ .accordion [data-radio="river"] {
  flex-grow: 1;
}

[value="Animal"]:checked ~ .accordion [for="animal"] + .accordion-content,
[value="Plant"]:checked ~ .accordion [for="plant"] + .accordion-content,
[value="Space"]:checked ~ .accordion [for="space"] + .accordion-content,
[value="River"]:checked ~ .accordion [for="river"] + .accordion-content {
  display: flex;
}

[value="Animal"]:checked ~ .accordion [for="animal"],
[value="Plant"]:checked ~ .accordion [for="plant"],
[value="Space"]:checked ~ .accordion [for="space"],
[value="River"]:checked ~ .accordion [for="river"] {
  color: var(--active-color);
}

/*[value="Animal"]:focus ~ .accordion [for="animal"],
[value="Plant"]:focus ~ .accordion [for="plant"],
[value="Space"]:focus ~ .accordion [for="space"],
[value="River"]:focus ~ .accordion [for="river"] {
  outline: 1px solid var(--active-color);
}*/


/* MQ
–––––––––––––––––––––––––––––––––––––––––––––––––– */
@media screen and (max-width: 650px) {
  .accordion {
    min-height: 0;  
  }
  
  .accordion,
  .accordion li {
    flex-direction: column;
  }
  
  .accordion .accordion-title {
    flex-direction: row;
    width: auto;
  }
  
  .accordion .accordion-heading {
    transform: none;
  }
  
  .accordion .accordion-title,
  .accordion .accordion-content {
    padding: 20px;
  }
}


/* FOOTER
–––––––––––––––––––––––––––––––––––––––––––––––––– */
.page-footer {
  position: absolute;
  bottom: 10px;
  right: 10px;
  font-size: 1rem;
  color: var(--black);
}

.page-footer span {
  color: var(--red);
}
              
            
!

JS

              
                
              
            
!
999px

Console