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

              
                <div class="container">
  <h1 class="section__headline">FAQs</h1>
  <h2 class="c-faqs__headline">Initial Setup</h2>
  <ul class="c-faqs">
    <li class="c-faq c-faq--active">
      <span class="c-faq__title">Do you want to build a snowman?</span>
      <div class="c-faq__answer">Or ride our bikes around the halls I think some company is overdue I've started talking to the pictures on the walls (Hang in there, Joan!) It gets a little lonely All these empty rooms</div>
    </li>
    <li class="c-faq">
      <span class="c-faq__title">Is Twilight autobiographical?</span>
      <div class="c-faq__answer">No. Twilight is a work of fiction.</div>
    </li>
    <li class="c-faq">
      <span class="c-faq__title">What do Vegetarians and Vegans do for Thanksgiving?</span>
      <div class="c-faq__answer">Vegetarians and vegans enjoy all the same Thanksgiving pleasures as everyone else does, minus the turkey. There is an abundance of delicious vegetarian and vegan Thanksgiving food options available. Click here for compassionate Thanksgiving recipes.</div>
    </li>
  </ul>  <!-- /end c-faqs -->
  
    <h2 class="c-faqs__headline">Yolo swag</h2>
  <ul class="c-faqs">
    <li class="c-faq">
      <span class="c-faq__title">What’s the largest turkey you ever raised?</span>
      <div class="c-faq__answer">The largest turkey I have ever raised dressed out at 50.12 lbs.</div>
    </li>
    <li class="c-faq">
      <span class="c-faq__title">What do I do when there is an alligator in my neighborhood?</span>
      <div class="c-faq__answer">In many cases, if left unmolested, alligators eventually will retreat to more preferred habitats away from people. However, if you encounter an animal that poses a threat to human safety:
<br />
DON’T – swim outside of posted swimming areas or in waters that might contain large alligators.
        <br />
DO – swim with a partner within all marked swimming areas. These areas are specifically situated and designed to reduce potential alligator/human conflicts.
        <br/ >
DON’T – swim at night or dusk when alligators most actively feed.
</div>
    </li>
    <li class="c-faq">
      <span class="c-faq__title">Who pays for Princes William and Harry?</span>
      <div class="c-faq__answer">Both Prince William and Prince Harry receive a salary from the British Army. Any additional costs are met by The Prince of Wales or from their own private funds. If either Prince were to travel by air or train to an official engagement, these costs would be met from public funds.</div>
    </li>
    <li class="c-faq">
      <span class="c-faq__title">Can I use someone else’s urine in my Whizzinator Kit?</span>
      <div class="c-faq__answer">Yes, you can use someone else’s urine in our kit. We just ask that you be 110% sure the urine is clean before you use their urine. If you do use someone else’s urine simply collect the sample the day of your test and inject it into The Whizzinator with the refill syringe. Use the sample that day.</div>
    </li>
    <li class="c-faq c-faq">
      <span class="c-faq__title">Do I have to be fat to do sumo?</span>
      <div class="c-faq__answer">No, you do not have to be fat. In fact, most of the very successful sumo wrestlers, both professional and amateur, are not fat, by any standard. Generally, if you are athletic, you can do well in sumo. Of course, fat or skinny, big or small, you are welcome to participate in sumo.</div>
    </li>
  </ul>  <!-- /end c-faqs -->
  
    <h2 class="c-faqs__headline">Other questions</h2>
  <ul class="c-faqs">
    <li class="c-faq">
      <span class="c-faq__title">Do you ever re-use chocolate?</span>
      <div class="c-faq__answer">We never use chocolate left over from other rentals. We are more than happy to leave you with any chocolate left at the end of your rental if suitable bowls are provided.

</div>
    </li>
    <li class="c-faq">
      <span class="c-faq__title">When I’m tested for a STD, will everyone in the waiting room hear my name be called?</span>
      <div class="c-faq__answer">NO!  The clinician will call you by your assigned number, not your name.</div>
    </li>
    <li class="c-faq">
      <span class="c-faq__title">Can pregnant woman bellydance too?</span>
      <div class="c-faq__answer">Of course, pregnant women find belly dancing excellent prenatal exercise because it strengthens the pelvic muscles and loosens up the abdominal area. It strengthens back and leg muscles, which are very critical for a woman to carry her pregnancy well.</div>
    </li>
  </ul>  <!-- /end c-faqs -->
  
<span class="c-note">Source: <a href="http://www.usedfaqs.com/">usedfaqs.com</a></span>
</div>

              
            
!

CSS

              
                $brand: #1e88e5
$black: #333
$lightblack: #505050
$lightwhite: #f1f2f3

%visually-hidden
  position: absolute
  opacity: 0
  z-index: -1
  
body
  box-sizing: border-box
  font-family: 'ABeeZee', sans-serif
  line-height: 1.48
  font-size: 16px
  color: $black
  
body *,
body *::after,
body *::before
  box-sizing: inherit
  
.container
  max-width: 1100px
  margin-left: auto
  margin-right: auto

.section__headline
  font-family: 'Varela Round', sans-serif
  font-size: 62px
  font-weight: light
  color: $brand
  padding-left: 15px
  padding-top: 30px
  
.c-faqs__headline
  font-family: 'Varela Round', sans-serif
  text-align: left
  padding-left: 15px
  font-size: 1.5em
  margin-top: 1.5em
  font-weight: bold
  
// has each one of the faqs
.c-faqs
  margin: 15px 0
  padding: 0 15px
  border-top: 1px solid transparent // uncollapse margins
  border-bottom: 1px solid transparent

// the divider between titles and questions
// .c-faqs::before
//   width: 2px
//   height: 100%
//   left: 50%
//   position: absolute
//   background: $brand
//   opacity: 0
//   transform-origin: 0 50%
//   content: ''  

  
// a wrapper for each faq
.c-faq
  font-family: 'Varela Round', sans-serif
  list-style: none
  margin: 10px 0 5px

.c-faq__title
  cursor: pointer
  font-weight: 500
  background: white
  z-index: 10
  position: relative
  font-size: 1.1em
  &:hover
    text-decoration: underline
  &::after
    white-space: nowrap
    font-weight: 300
    padding-left: 5px
    opacity: 0
    transform-origin: 11px
    transform: rotateZ(90deg)
    display: none
    content: '>'

// active faqs should be a little different
.c-faq--active .c-faq__title
  color: $brand
  // the > icon
  &::after
    opacity: 1
    transform: rotateZ(90deg)
    display: inline-block    

// the actual body of answer
.c-faq__answer
  @extend %visually-hidden
  font-weight: normal
  margin-top: -10%
  transition: all 0.1s
  z-index: 1
  font-size: 0.9em
  color: $lightblack

.c-faq--active .c-faq__answer
  opacity: 1
  position: relative
  top: 0
  left: 0
  font-weight: 300
  margin-top: 5px
  margin-bottom: 10px
  transition: all 0.2s
  border-radius: 3px
  border: 1px solid $lightwhite
  border-top: 1px solid $brand
  padding: 20px
  
@media (min-width: 780px) 
  // use this as the 'wrapper' to position the answer
  .c-faqs
    position: relative
    margin-left: auto
    margin-right: auto
    height: auto
    
  // the bar betweeen question and answer
  .c-faqs::before  
    opacity: 0.2
    
  .c-faq
    margin-top: 15px
    margin-bottom: 15px
    
    // title and answer shouldn't touch
    .c-faq__title
      width: 50%
      padding-right: 40px
      display: inline-block
      // the > icon
      &::after
        display: none

    // make this ver center, because questions will always will be higher :)
    .c-faq__answer
      position: absolute
      top: 50%
      transform: translateY(-50%)
      left: 50%
      width: 50%
      border-left-color: $brand
      border-top-color: $lightwhite
      
      
.c-note
  font-size: 0.8em
  padding-left: 15px
  opacity: 0.5
  transition: opacity 0.2s ease-in-out
  
  &:hover
    opacity: 1
    transition: opacity 0.2s ease-in-out
  
  a
    color: $brand
              
            
!

JS

              
                $('body').delegate('.c-faq', 'click', function(){
  $('.c-faq').removeClass('c-faq--active');
  $(this).addClass('c-faq--active');
});
              
            
!
999px

Console