css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <div class="wrapper">
  Here are some styles for making some fancy links using pure <a data-popup="Cascading Style Sheets - Wikipedia" href="http://en.wikipedia.org/wiki/Cascading_Style_Sheets#CSS_3">CSS3</a> and <a data-popup="HTML5 - Wikipedia" href="http://en.wikipedia.org/wiki/HTML5">HTML5</a> (data- attributes) without using any additional tags for layout. They make use of the <code class="prettyprint lang-css">::before</code> and <code class="prettyprint lang-css">::after</code> pseudo-elements as discussed in one of my <a data-popup="Growing with the Web: Pseudo-classes vs pseudo-elements" href="https://danielimms.blogspot.com.au/2012/08/pseudo-classes-vs-pseudo-elements.html">recent posts</a>&nbsp;in <a data-popup="Thoughts, tutorials and cool stuff on software development, computer science, the web and mobile." href="https://danielimms.blogspot.com.au/">Growing with the Web</a>.
</div>
            
          
!
            
              .wrapper {
  width: 600px;
  margin: 0 auto;
}

a[data-popup] {
    $popup-background-color: #000;
    $popup-color: #FFF;
    $popup-opacity: .75;
    $popup-top: 20px; // Should be &gt;= line-height
    $popup-left: 20px;
    $popup-arrow-size: 15px;
    $popup-padding: 8px;

    position: relative;
    display: inline-block; // Fixes links that wrap

    &:hover {
        &::after {
            content: attr(data-popup);
            display: block;
            position: absolute;
            background: $popup-background-color;
            opacity: $popup-opacity;
            min-width: ($popup-left + $popup-arrow-size) * 4;
            max-width: 250px;
            padding: $popup-padding;
            top: $popup-top + $popup-arrow-size;
            color: $popup-color;
            z-index: 100; // We want this on top of everything
        }

        &::before {
            content: "";
            display: block;
            position: absolute;
            bottom: 0;
            border-left: $popup-arrow-size solid transparent;
            border-right: $popup-arrow-size solid transparent;
            border-bottom: $popup-arrow-size solid $popup-background-color;
            opacity: $popup-opacity;
            top: $popup-top;
            left: $popup-left;
        }
    }
}
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console