Pen Settings



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


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


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.


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.


                h1 FAQ

// Accessibility pattern:

// place the role of "group" on the details wrapper
// place the role of "button" on the summary, which lets the user know they can interact with the element

  summary(role="button", aria-expanded="false") <strong>How many fingers am I holding up?</strong>
  p I'm not sure. I can't see your hand.  Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ducimus eius totam sed iusto harum, fuga officia incidunt facere neque obcaecati, amet nihil perspiciatis. Laborum reprehenderit, totam illum ab. Asperiores nobis blanditiis unde saepe praesentium, facere eligendi, voluptatem accusamus odio nulla consequuntur quod sint alias dolores reprehenderit dignissimos earum officia minima vero nesciunt natus sed ad ex iure. Atque nam molestias, dolore alias facere expedita perspiciatis, fuga est, rerum laboriosam nulla unde iste saepe in autem blanditiis quaerat sit? Magni alias eum aliquid esse corrupti amet ex delectus, ab odio neque, eaque, sapiente nulla at distinctio asperiores fugit id maxime! Obcaecati aperiam ullam, vitae quidem eaque possimus, adipisci molestias, debitis iusto accusantium similique, harum neque quia dignissimos voluptatibus repellat qui deleniti.

  summary(role="button", aria-expanded="false") <strong>What color is the sky?</strong>
  p The sky is blue.



  font-family: 'Raleway', sans-serif
  text-align: center

// the outer wrapper for each faq question and answer
  margin: 2rem auto
  width: 75% // controls the width of the outer wrapper
  // styles for the answer that is revealed on click
    padding: 2rem 5rem
    line-height: 2
    font-size: .9rem
    text-align: left
// controls the question part that is to be clicked
  display: block // required to remove default triangles in Firefox
  // hides the default triangle before the summary
    display: none
  // replace the default triangle with a new symbol
    display: inline-block // allows rotating the pseudo element
    content: '\203A'
    margin-right: .5rem
    font-weight: bold
    font-size: 1rem
    transition: all 300ms ease // creates animation for rotating marker
  // makes element look like a clickable link on hover
    cursor: pointer
// controls when the details wrapper is in the open, or clicked, state
  // change question styles
    color: red // change question color to red
    transition: all 300ms ease // eases the color transition
    animation: openDetail 400ms ease // applies animation to answer that is being revealed
    background: #f9f9f9 // preserves background color on open
    transform: rotate(90deg) // rotates the arrow before the question
// animation for the click event
// animated properties: opacity, background, Y position
@keyframes openDetail
    opacity: 0
    background: white
    transform: translateY(0%)
    transform: translateY(3%) // half way through, provides a little bounce
    opacity: 1
    background: #f9f9f9
    transform: translateY(0%) // brings the element back to 0, finishing the bounce effect