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. 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

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

              
                <html>
  
  <head></head>
  <body>
    This is pixel based css and should show open/close behaviour on:hover
<div id="panels">
<ul id="kwicks">
  <li><a class="john" href="http://en.wikipedia.org/wiki/John_lennon" title="John Lennon">John Lennon</a></li>
  <li><a class="paul" href="http://en.wikipedia.org/wiki/Paul_mccartney" title="Paul McCartney">Paul McCartney</a></li>
  <li><a class="george" href="http://en.wikipedia.org/wiki/George_harrison" title="George Harrison">George Harrison</a></li>
  <li><a class="ringo" href="http://en.wikipedia.org/wiki/Ringo_starr" title="Ringo Starr">Ringo Starr</a></li>
  <li><a class="ringo" href="http://en.wikipedia.org/wiki/Stuart_Sutcliffe" title="Ringo Starr">Stuart Sutcliffe</a></li>
</ul>
</div>
 This is percentage based and should show same behaviour (doesn't bc li a=20% and li has no width defined, so 20% of nothing=nothing === my guess), howto solve ?   
<div id="panels">
<ul id="kwicks2">
  <li><a class="john" href="http://en.wikipedia.org/wiki/John_lennon" title="John Lennon">Percentage</a></li>
  <li><a class="paul" href="http://en.wikipedia.org/wiki/Paul_mccartney" title="Paul McCartney">Percentage</a></li>
  <li><a class="george" href="http://en.wikipedia.org/wiki/George_harrison" title="George Harrison">Percentage</a></li>
  <li><a class="ringo" href="http://en.wikipedia.org/wiki/Ringo_starr" title="Ringo Starr">Percentage</a></li>
  <li><a class="ringo" href="http://en.wikipedia.org/wiki/Stuart_Sutcliffe" title="Ringo Starr">Percentage</a></li>
</ul>
</div>
    
  </body>
</html>
              
            
!

CSS

              
                /* structure */
#panels { background: blue; width: 100%; padding: 0 4%; margin: 10px 0; }
#kwicks,
#kwicks2 { 
  width: 100%; 
  max-width: 1000px; 
  overflow-x: hidden; 
  background: green; 
  padding: 0; 
  margin: 0 auto; 
}

#kwicks:hover li a { width: 175px; background: orange; }
#kwicks li { 
  position: relative;
  float: left; 
  overflow-x: hidden; 
  display: block; 
  background: yellow;
}

/* individual kwicks */
#kwicks li a { 
  display: block; 
  text-indent: -9999px; 
  width: 200px;
  height: 103px;
  transition-property: width;
  transition-duration: .5s;
  -webkit-transition-property: width;
  -webkit-transition-duration: .5s;
}
#kwicks li:last-child { float: right; }

#kwicks li:hover a { width: 300px !important; background: red; }


/* ---------------------------- */
/* Second bar - percentage based */
#kwicks2 { background: SteelBlue; }
#kwicks2:hover li a { width: 17.5%; background: LimeGreen; }
#kwicks2 li { 
  position: relative;
  float: left; 
  overflow-x: hidden; 
  display: block; 
  background: yellow;
}

/* individual kwicks */
#kwicks2 li a { 
  display: block; 
  text-indent: -9999px; 
  width: 20%;
  height: 103px;
  transition-property: width;
  transition-duration: .5s;
  -webkit-transition-property: width;
  -webkit-transition-duration: .5s;
}
#kwicks2 li:last-child { float: right; }

#kwicks2 li:hover a { width: 30% !important; background: Crimson; }
              
            
!

JS

              
                
              
            
!
999px

Console