cssAudio - ActiveCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmloctocatspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

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.

            
              <ul>
  <li><a href="#">First item</a></li>
  <li><a href="#">Other item</a></li>
  <li><a href="#">and...</a></li>
  <li><a href="#">Last item!</a></li>
</ul>
            
          
!
            
              
$height: 100;      // default: height of menu
$skew-angle: 20;   // default: angle

@import "compass"; // import compass for easier math functions: http://compass-style.org/reference/compass/helpers/math/#tan

$a: tan( $skew-angle * 1deg ) * $height;  // calculate opposite leg of triangle

body {
  margin: 0;
  padding: 0;
  font: normal small-caps normal 18px/150% Arial, Helvetica, sans-serif;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;   
  width: 100%;
  display: flex;
  overflow: hidden; // prevent vertical scrollbar
  li {
    flex: 1 auto; // distribute children to container size
    -webkit-transform: skew( $skew-angle * -1deg );
    overflow: hidden; // hide overlapping links with negative margins
    margin: auto;
    margin-left: -1px; // compensate rendering issues
    &:first-child {
      margin-left: $a / 2 * -1px; // negative margins to compensate cut off triangle
      padding-left: $a / 4 * 1px; // padding to keep text visible with extreme skew angles
    }
    &:last-child {
      margin-right: $a / 2 * -1px;
      padding-right: $a / 4 * 1px;
    }
    a {
      display: block;
      -webkit-transform: skew( $skew-angle * 1deg );
      margin: 0  $skew-angle / 2 * -1em; // #tbd tweak with $a
      padding: 0  $skew-angle / 2 * 1em; // #tbd tweak with $a
      line-height: $height * 1px;
      background: red;
      color: #FFF;
      text-align: center;
      text-decoration: none;
      &:hover {
        color: red;
        background-color: #e2e2e2;
      }
    }
  }
}
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console