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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                <h1 class="ct">Bootstrap 3.3.5</h1>
<div class="ct"><small>Tooltip and Popover for multiple elements</small></div>

<div class="multiple_elements">
  
  <h2>TOOLTIP</h2>
  <div class="ct"><small>Hover/tap on the element</small></div>
  
  <div class="btn-group">
    <button type="button" class="btn btn-primary ole" data-toggle="tooltip" data-placement="left" data-original-title="this is a left tooltip">
      OLE
    </button>

    <button type="button" class="btn btn-primary ole two" data-toggle="tooltip" data-placement="top" data-original-title="this is a top tooltip">
      OLE
    </button>

    <button type="button" class="btn btn-primary ole three" data-toggle="tooltip" data-placement="bottom" data-original-title="this is a bottom tooltip">
      OLE
    </button>

    <button type="button" class="btn btn-primary ole four" data-toggle="tooltip" data-placement="right" data-original-title="this is a right tooltip">
      OLE
    </button>
  </div>

</div>

<div class="multiple_elements">

  <h2>POPOVER</h2>
  <div class="ct"><small>Click/tap the element to toggle the popover</small></div>
  
  <div class="btn-group">
    <button type="button" class="btn btn-primary elo four" data-toggle="popover" data-placement="left" data-original-title="LEFT POPOVER" data-content="The paragraph within the popover is using <code>data-content</code> attribute.">
      ELO
    </button>

    <button type="button" class="btn btn-primary elo three" data-toggle="popover" data-placement="top" data-original-title="TOP POPOVER" data-content="The paragraph within the popover is using <code>data-content</code> attribute.">
      ELO
    </button>

    <button type="button" class="btn btn-primary elo two" data-toggle="popover" data-placement="bottom" data-original-title="BOTTOM POPOVER" data-content="The paragraph within the popover is using <code>data-content</code> attribute.">
      ELO
    </button>

    <button type="button" class="btn btn-primary elo" data-toggle="popover" data-placement="right" data-original-title="RIGHT POPOVER" data-content="The paragraph within the popover is using <code>data-content</code> attribute.">
      ELO
    </button>
  </div>
  
</div>
              
            
!

CSS

              
                body {
  background: #eee;
  min-height: 520px;
}

body,
h1,
h2,
h3,
h4,
div,
button {
  font-family: consolas, courier, monaco, menlo, monospace;
}

.ole,
.elo {
  background: rgb(200,240,255);
  padding: 6px 36px;
  display: inline-block;
  font-size: 1.2em;
  border-radius: 4px;
  border:0;
  cursor: pointer;
  color: #000;
}

.ct {
  text-align: center
}

.two {
  background: rgb(180,220,255);
}

.three {
  background: rgb(160,200,255);
}

.four {
  background: rgb(140,180,255);
}

.ole:hover,
.elo:hover {
  background: dodgerblue;
  color: #fff;
  text-shadow: 1px 1px 1px #000;
  box-shadow: 0 0 0 #555;
}

.multiple_elements {
  padding: 30px 0 10px 0;
  text-align: center;
}

/*customizing tooltip color*/
/*right tooltip*/
.tooltip.right > .tooltip-arrow {
  border-right-color: dodgerblue;
}

/*bottom tooltip*/
.tooltip.bottom > .tooltip-arrow {
  border-bottom-color: dodgerblue;
}

/*top tooltip*/
.tooltip.top > .tooltip-arrow {
  border-top-color: dodgerblue;
}

/*left tooltip*/
.tooltip.left > .tooltip-arrow {
  border-left-color: dodgerblue;
}

/*tooltip inner*/
.tooltip > .tooltip-inner {
  background-color: dodgerblue;
  text-shadow: 0 1px 1px #000;
  font-weight: normal;
}

code {
  color: royalblue;
  background-color: azure;
}

@media (max-width:640px) {
  .ole,
  .elo {
    padding: 6px 12px;
    font-size: 12px;
  }
}
              
            
!

JS

              
                /*
  We can use [body] or the element class/id that wraps the elements with tooltip/popover.
  Include the data-[] attribute in each element that needs it.
*/
$(document).ready(function () {
  //can also be wrapped with:
  //1. $(function () {...});
  //2. $(window).load(function () {...});
  //3. Or your own custom named function block.
  //It's better to wrap it.

  //Tooltip, activated by hover event
  $("body").tooltip({   
    selector: "[data-toggle='tooltip']",
    container: "body"
  })
    //Popover, activated by clicking
    .popover({
    selector: "[data-toggle='popover']",
    container: "body",
    html: true
  });
  //They can be chained like the example above (when using the same selector).
  
});
              
            
!
999px

Console