LOADING...

Preview

Pen ID
Unlock Campus Themeforest adv

 

Code

CSS3 Accordion Test (No height: auto transition)

  • Accordion 1

    Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.

  • Accordion 2

    Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus

  • Accordion 3

    Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus

  • Accordion 4
    Definition list
    Consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
    Lorem ipsum dolor sit amet
    Consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
  • Accordion 5
    • Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
    • Aliquam tincidunt mauris eu risus.
    • Vestibulum auctor dapibus neque.
one does not simply animate height: auto
CSS
*, *:before, *:after {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  height: 100%;
  background: #2C3E50;
  font-family: Corbel, "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", "DejaVu Sans", "Bitstream Vera Sans", "Liberation Sans", Verdana, "Verdana Ref", sans-serif;
}

h1, blockquote {
  color: #fafafa;
  text-align: center;
}

code {
  font-family: Consolas, "Andale Mono WT", "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco, "Courier New", Courier, monospace; 
  margin: 0 0.1em;
  background: #1B2938;
  padding: 0 0.5em 0.2em;
}

img {
  float: left;
  margin: 0 1em 0 0;
}

p {
  margin: 0 0 1.5em 0; 
}

.accordion {
  display:block;
  position: relative;
  width: 500px;
  margin: 10px auto;
  height: auto;
  box-shadow: 0 2px 5px rgba(0,0,0,.25);
}

.accordion > ul {
  display: block;
  list-style: none;
  padding :0;
  margin: 0;
}

.accordion > ul > li {
  display: block;
  position: relative;
  margin-bottom: -1px;
  overflow: hidden;
  color: #486992;
  background: #fafafa;
  border: 1px solid #D1D1D1;
}

.accordion > ul > li:first-child {
  border-radius: 0.3em 0.3em 0 0;
}

.accordion > ul > li:last-child {
  border-radius: 0 0 0.3em 0.3em;
}

.acc-handle {
  display:block;
  position: relative;
  padding: 1.5em;
  color: #486992;
  background: #f1f1f1;
  text-decoration: none;
  z-index: 3;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
  transition: all .25s ease;
}

.acc-handle:hover {
  color: #2F71C4;
  background: #fafafa;
}

.acc-handle:before, .acc-handle:after {
  content: '';
  position: absolute;
  transition: all .3s ease;
}

.acc-handle:before {
  width: 1em;
  border-top: .15em solid;
  border-bottom: .15em solid;
  top: 50%;
  margin-top: -0.15em; 
  right: 1.45em;
}

.acc-handle:after {
  height: 1em;
  width: 0.3em;
  border-top: 0.5em solid;
  border-bottom: 0.5em solid;
  right: 1.8em;
  top: 50%;
  margin-top: -0.55em;
}

.acc-panel {
  padding: 1.5em;
  position: relative;
  float: left;
  width: 100%;
  clear: both;
  margin-top: -100%;
  z-index: 1;
  transition: all 1.2s ease;
}

.acc-handle:focus {
  outline: none;
  background: #e7e7e7;
}

.acc-handle:focus:after{
  height: 0;
  border: 0;
  margin-top: 0;
  opacity: 0;
}

.acc-handle:focus + .acc-panel {
  margin-top: 0;
  border-top: 1px solid #d1d1d1;
  transition: all 0.6s ease-in-out;
}

.acc-panel * { 
  opacity: 0;
  transition: all 1s linear;
}

.acc-handle:focus + .acc-panel * {
  opacity: 1;
}
Host Instantly Drag and Drop Website Builder

 

Term
Mon, 11/27/2017 - 22:09

Related Codes

Pen ID
Pen ID
Pen ID