Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

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.

+ 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

Auto Save

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="accordion">
            <input class="accordion__radio" type="radio" name="accordion-tabs" id="tab-one" checked/>
            <label class="accordion__label" for="tab-one">Tab 1
              <span class="accordion-tab--status"></span>
            </label>
            <div class="accordion__content">
              <div class="accordion__content__image__container">
                <img class="accordion__content__image" src="https://source.unsplash.com/random/801x801" alt="placeholder alt text" />
              </div>
              <div class="accordion__content__text">
                <h3 class="accordion__content__text__title">Khalid Ipsum
                  <hr class="accordion__content__text__horizontal-line" />
                </h3>
                <p class="accordion__content__text__body">
                  To be successful you’ve got to work hard, to make history, simple, you’ve got to make it. Give thanks to the most high. To
                  be successful you’ve got to work hard, to make history, simple, you’ve got to make it.
                </p>
                <p class="accordion__content__text__body">
                  The key to more success is to get a massage once a week, very important, major key, cloth talk. How’s business? Boomin. Hammock
                  talk come soon. To be successful you’ve got to work hard, to make history, simple, you’ve got to make it. Hammock
                  talk come soon.
                </p>
              </div>
            </div>
            <input class="accordion__radio" type="radio" name="accordion-tabs" id="tab-two" />
            <label class="accordion__label" for="tab-two">Tab 2
              <span class="accordion-tab--status"></span>
            </label>
            <div class="accordion__content">
              <div class="accordion__content__image__container">
                <img class="accordion__content__image" src="https://source.unsplash.com/random/802x802" alt="placeholder alt text" />
              </div>
              <div class="accordion__content__text">
                <h3 class="accordion__content__text__title">
                   Corporate Ipsum
                  <hr class="accordion__content__text__horizontal-line" />
                </h3>
                <p class="accordion__content__text__body">Leverage agile frameworks to provide a robust synopsis for high level overviews. Iterative approaches to corporate strategy
                foster collaborative thinking to further the overall value proposition. 
                </p>
                <p class="accordion__content__text__body">Bring to the table win-win survival strategies to ensure proactive domination. At the end of the day, going forward, a new
                normal that has evolved from generation X is on the runway heading towards a streamlined cloud solution. 
                </p>
              </div>
            </div>
            <input class="accordion__radio" type="radio" name="accordion-tabs" id="tab-three" />
            <label class="accordion__label" for="tab-three">Tab 3
              <span class="accordion-tab--status"></span>
            </label>
            <div class="accordion__content">
              <div class="accordion__content__image__container">
                <img class="accordion__content__image" src="https://source.unsplash.com/random/803x803" alt="placeholder alt text" />
              </div>
              <div class="accordion__content__text">
                <h3 class="accordion__content__text__title">
                  Skate Ipsum
                  <hr class="accordion__content__text__horizontal-line" />
                </h3>
                <p class="accordion__content__text__body">Skate ipsum dolor sit amet, backside kingpin varial Christ air sponsored kick-nose rad Kris Markovich. Lip face plant tic-tac
                quarter pipe tuna-flip berm 540. Primo slide Steve Alba ledge mongo masonite boned out hang ten varial. 
                </p>
                <p class="accordion__content__text__body">Bearings 1080 smith grind Dylan Rieder launch ramp disaster. John Lucero flypaper goofy footed judo air melancholy nose grab.
                Axle freestyle 540 hang up bail. Lip 900 drop in rip grip half-flip. Lip steps boned out skate or die aerial. Rad Kevin Harris
                hip shoveit lip.  
                </p>
              </div>
            </div>
            <input class="accordion__radio" type="radio" name="accordion-tabs" id="tab-four" />
            <label class="accordion__label" for="tab-four">Tab 4
              <span class="accordion-tab--status"></span>
            </label>
            <div class="accordion__content">
              <div class="accordion__content__image__container">
                <img class="accordion__content__image" src="https://source.unsplash.com/random/804x804" alt="placeholder alt text" />
              </div>
              <div class="accordion__content__text">
                <h3 class="accordion__content__text__title">
                  Batman Ipsum
                  <hr class="accordion__content__text__horizontal-line" />
                </h3>
                <p class="accordion__content__text__body">But we've met before. That was a long time ago, I was a kid at St. Swithin's, It used to be funded by the Wayne Foundation.
                It's an orphanage. My mum died when I was small, it was a car accident. I don't remember it. My dad got shot a couple of
                years later for a gambling debt. Oh I remember that one just fine. Not a lot of people know what it feels like to be angry
                in your bones. I mean they understand. The fosters parents. Everybody understands, for a while. Then they want the angry
                little kid to do something he knows he can't do, move on. </p>
              </div>
            </div>
          </div>
              
            
!

CSS

              
                :root {
  --color-one: #34D1D1;
  --color-two: #2F2235;
  --color-three: #3F3244;
  --color-four: #F2F2F2;
  --color-five: #D1D2D3;
  --color-six: #666666;
  --color-seven: #000000;
  --color-eight: #ffffff;
}

html {
  font-family: 'Open Sans', sans-serif;
}

.accordion {
  display: flex;
  flex-wrap: wrap;
  height: auto;
  width: 100%;
}

.accordion__content {
  order: 1;
  flex-grow: 1;
  width: 100%;
  height: 100%;
  display: none;
}

.accordion__label {
  display: block;
  cursor: pointer;
  flex-grow: 1;
  text-align: center;
  padding: 1% 5% 1% 5%;
  background-color: var(--color-four);
  margin-right: 1px;
  border-bottom: 1px solid var(--color-five);
}

.accordion__radio {
  display: none;
}

.accordion input[type="radio"] {
	display: none;
}

.accordion input[type="radio"] + label {
   color: var(--color-six);
   z-index: 1;
}

.accordion input[type="radio"]:checked + label {
  background-color: white;
  font-weight: 600;
  border-top: 1px solid var(--color-five);
  border-left: 1px solid var(--color-five);
  border-right: 1px solid var(--color-five);
  border-bottom: none;
}
.accordion input[type="radio"]:checked + label + .accordion__content {
	display: flex;
  margin-right: 0;
  border-left: 1px solid var(--color-five);
  border-right: 1px solid var(--color-five);
  border-bottom: 1px solid var(--color-five);
}

.accordion__content__image__container {
  width: 40%;
  height: 100%;
  margin-right: 10px;
}

.accordion__content__image {
  max-width: 100%;
  max-height: 88%;
  margin: 3%;
  background-color: teal;
}

.accordion__content__text {
  width: 75%;
  margin-top: 1%;
  margin-left: 40px;
}

.accordion__content__text__title {
  margin-top: 3%;
}

.accordion__content__text__horizontal-line {
  border: none;
  border-bottom: 1px solid var(--color-five);
  margin-right: 2%;
}

.accordion__content__text__body {
  margin-top: 2%;
  padding-right: 5%;
}

@media (max-width: 900px){
  .accordion {
    border: 1px solid var(--color-five);
  }
  
  .accordion-tab--status {
    display: inline;
  }
  .accordion__content,
  .accordion__label
  {
    order: initial;
  }
  
  .accordion__content {
    flex-direction: column;
  }
  
  .accordion__label {
    width: 100%;
    margin-right: 0;
    margin-bottom: 1px;
    display: flex;
    justify-content: space-between;
    font-size: 1.2em;
    padding: 5% 6% 5% 6%;
  }

  .accordion__label:last-child {
    background-color: magenta;
  }

  .accordion__content__image__container {
    width: 100%;
  }

  .accordion__content__image {
    padding: 0;
    margin: 0;
    object-fit: cover;
    height: 300px;
    width: 100%;
  }

  .accordion__content__text {
    font-size: 0.9em;
    margin: 4% 5% 4% 5%;
  }

  .accordion__content__text__title {
    margin: 2% 0 2% 0;
  }

  .accordion__content__text__horizontal-line {
    width: 100%;
  }

  .accordion input[type="radio"] + label span:after  {
    content: '+';
  }

  .accordion input[type="radio"]:checked + label span:after  {
    content: '—';
  }

  .accordion input[type="radio"]:checked + label {
    border: none; 
  }

  .accordion input[type="radio"]:checked + label + .accordion {
    border: none;  
  }

  .accordion input[type="radio"]:checked + label + .accordion__content {
    border: none;
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console