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

              
                <ul class="acordeon">
  <li>
    <h4>Yecla</h4>
    <a href="#">
      <img src="https://1.bp.blogspot.com/-na8syCqA5QM/U2Y0MkeZeFI/AAAAAAAAPyA/5C7WeCVpcyE/s900/yecla.jpg"/>
    </a>
  </li>
  <li>
    <h4>Ricote</h4>
    <a href="#">
      <img src="https://3.bp.blogspot.com/-0VLtdXRmROw/U2Y0MBkDjKI/AAAAAAAAPx8/2WHDkLKpo3g/s900/ricote.jpg"/>
    </a>
  </li>
  <li>
    <h4>Bullas</h4>
    <a href="#">
      <img src="https://4.bp.blogspot.com/-dx4GDtQCuCY/U2Y0LT8IlRI/AAAAAAAAPxo/4XW_d21QrMk/s900/bullas.jpg"/>
    </a>
  </li>
  <li>
    <h4>Jumilla</h4>
    <a href="#">
      <img src="https://4.bp.blogspot.com/-8vVOgYUvpRA/U2Y0LTWXwFI/AAAAAAAAPxs/HPnmp59MYtk/s900/jumilla.jpg"/>
    </a>
  </li>
  <li>
    <h4>Abanilla</h4>
    <a href="#">
      <img src="https://4.bp.blogspot.com/-yyHs3e39Tsg/U2Y0LHHoRmI/AAAAAAAAPxk/TnqknfWjR0s/s900/abanilla.jpg"/>
    </a>
  </li>
</ul>
              
            
!

CSS

              
                /* Ajustes generales */
html, body {
  margin: 0;
  padding:0;
  background: #ccc;
}
ul.acordeon * {
  font-family: Arial, sans-serif;
  -webkit-transition: all .6s ease-in-out;
  -moz-transition: all .6s ease-in-out;
  transition: all .6s ease-in-out;
}
/* Contenedor general */
ul.acordeon {
  width: 100%; /* Personalizar sncho total */
  overflow: hidden;
  padding: 0;
  background: #8F2250;
  text-align: center;
  list-style: none;
  font-size: 0;
  box-shadow: 0 0 10px #333;
}
/* Cada elemento */
ul.acordeon li {
  position: relative;
  display: inline-block;
  *display: inline; zoom: 1; /* IE7 */
  width: 10%; 
  height:0;
  padding-bottom: 40%; /* Ratio aspecto imagen = (height*X)/width */
  background: #eee;
  text-align: center;
  box-shadow: -2px 0px 8px #999;
}
/* Títulos pestañas */
ul.acordeon li h4 {
  position: relative;
  top: 5%;
  z-index: 1;
  margin: 0;
  font-size: 18px;
  text-align: left;
  text-transform: uppercase;
  -webkit-transform: rotate(90deg);
  -moz-transform: rotate(90deg);
  transform: rotate(90deg);
  -webkit-transform-origin: 10% 120%;
  -moz-transform-origin: 10% 120%;
  transform-origin: 10% 120%;
  white-space: nowrap;
}
/* Contenido inicialmente oculto */
ul.acordeon li a, ul.acordeon li img {
  position: absolute;
  bottom: 0;
  right: 0;
  display: inline-block;
  *display: inline; zoom: 1; /* IE7 */
  width: 0;
  padding:0;
  background: #333;
}
/* Hover: Desplegamos elemento aumentando su ancho */
ul.acordeon li:hover {
  width: 60%; /* 100 - 10*(nºelem-1) // X=60 para ratio imagen */ 
  background: #333;
}
/* Hover: Hacemos que el título recupere la horizontal y le ponemos un fondo */
ul.acordeon li:hover h4 {
  padding-left: 10px;
  background: rgba(143,34,80,.8);
  color: #eee;
  -webkit-transform: none;
  -moz-transform: none;
  transform: none;
}
/* Hover: Expandimos el contenido */
ul.acordeon li:hover a, ul.acordeon li:hover a img {
  width: 100%; 
}
/* Ajustes para resoluciones pequeñas */
@media(max-width:600px) {
  ul.acordeon li h4 {
    font-size: 12px;
    letter-spacing: 1px;
  }
}

/* VARIACIONES PARA CONSEGUIR QUE EL MENU OCUPE INICIALMENTE TODO EL ANCHO 
ul.acordeon li {
  width: 20%;
}
ul.acordeon:hover li {
  width: 10%;
}
ul.acordeon li:hover {
  width: 60%;
}
*/

              
            
!

JS

              
                
              
            
!
999px

Console