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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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>
<body>
<div>            
  This was written for the WordPress plugin Hints. Hints or info-cards, make your user's reading experience, a tad bit better. <span class="wphints-container" style="display:inline;">   <a href="javascript:void(0);" data-box-id="data-box-id-1" class="better-links"><img src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij4gICAgPHBhdGggZD0iTTAgMGgyNHYyNGgtMjR6IiBmaWxsPSJub25lIi8+ICAgIDxwYXRoIGQ9Ik0xMiAyYy01LjUyIDAtMTAgNC40OC0xMCAxMHM0LjQ4IDEwIDEwIDEwIDEwLTQuNDggMTAtMTAtNC40OC0xMC0xMC0xMHptNSAxMWgtNHY0aC0ydi00aC00di0yaDR2LTRoMnY0aDR2MnoiLz48L3N2Zz4=" valign="middle" class="wphints-plus-button" height="24" width="24" ></a> <span class="wphints-data-box" id="data-box-id-1" ><span class="wphints-triangle"></span><span class="wphints-main-content">Hints enables you to provide a better UX with respect to links/topics. Some keywords/words, need more explanation or/and external resources to be explained further, if the user needs to know more. Normally, you would achieve this by creating a link/anchor to that resource. Hints, makes it possible for your users to get additional information, about a topic/resource, without leaving your post. Too many links in a post, do spoil the broth. <a href="https://sojourner.co/blog/code/wp-plugin-hints.html" target="_blank">More about the WP Plugin Hints.  </a></span></span></span>
</div>
</body>
</html>
              
            
!

CSS

              
                /*Written for WP Hints Plugin, by Sojourner.co */
.wphints-data-box{
  display:none;
  z-index:999;
    border:1px solid #a7a7a7;
    position:absolute;
    box-shadow:1px 5px 10px 1px #a9a9a9;
    background:#fff;
    max-width: 25%;
    
}

.wphints-triangle{
    width:0px; 
    height: 0; 
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-bottom: 7px solid #666;
    display:block;
    margin-top:-7px;
    z-index:999;
}

img.wphints-plus-button{
    display:inline !important;
	vertical-align:middle;
}

.wphints-container{
    display: inline;

}


.wpbox_rotate {
  -webkit-transform: rotate(180deg);  /* Chrome, Safari 3.1+ */
     -moz-transform: rotate(180deg);  /* Firefox 3.5-15 */
      -ms-transform: rotate(180deg);  /* IE 9 */
       -o-transform: rotate(180deg);  /* Opera 10.50-12.00 */
          transform: rotate(180deg);  /* Firefox 16+, IE 10+, Opera 12.50+ */
}
.wpbox_transition {
  -webkit-transition: all 1s ease-out;  /* Chrome 1-25, Safari 3.2+ */
     -moz-transition: all 1s ease-out;  /* Firefox 4-15 */
       -o-transition: all 1s ease-out;  /* Opera 10.50–12.00 */
          transition: all 1s ease-out;  /* Chrome 26, Firefox 16+, IE 10+, Opera 12.50+ */
}
.wphints-main-content{
  padding:30px 15px 15px 15px; 
  display:block;
  font-size:16px;
}

              
            
!

JS

              
                jQuery(document).ready(function(){
    var blLineHeight = jQuery("body").css("line-height");
    var openHint = false;
    blLineHeight = blLineHeight.substring(0,blLineHeight.length-2);
    jQuery(".better-links img").parent("a").css("border-bottom","none");
    jQuery(".better-links").on("click",function(e){
        showElementId = jQuery(this).attr("data-box-id");
        showPosition = jQuery(this).position();
        parentPosition = jQuery(this).width()/2;
        rotateButton = jQuery(this).children("img");
        rotateButton.addClass('wpbox_rotate wpbox_transition');
       
        if(jQuery("#"+showElementId).css("display")=="none"){
          parentPosition = ((showPosition.left + parentPosition) - (jQuery("#"+showElementId).width()/2) - 6)
            
            jQuery(".wphints-data-box").css("display","none");
            jQuery("#"+showElementId).css("top",showPosition.top+parseInt(blLineHeight)+5);
            jQuery("#"+showElementId).css("left",parentPosition);
            
            jQuery("#"+showElementId).css("display","block");    
            jQuery("#"+showElementId+" > span.wphints-triangle").css("margin-left","50%");
            openHint = true;

        }else{
            openHint = false;
            rotateButton.addClass('wpbox_rotate wpbox_transition');
            jQuery(".wphints-data-box").css("display","none");
            jQuery("#"+showElementId).css("display","none"); 
            jQuery(".wphints-plus-button").removeClass("wpbox_rotate wpbox_transition");
        }
        
    });
   
    
});
              
            
!
999px

Console