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="buddypress-wrap">

<h1>BP Tooltips Playground - Alt Two - White Tooltips</h1>
<p>For: <a href="https://buddypress.trac.wordpress.org/ticket/7188">BP Trac #7188</a></p>
  <p>See <a href="https://codepen.io/mercime/pen/RKaQbj">Black Tooltips</a></p>
  

<h2>A. Icon Fonts in empty links </h2>
  
<a class="message-action bp-tooltip" data-bptooltip="Star this message" aria-label="Star this messaage" data-status="star" data-star-nonce="fae1acf32e" data-message-id="6" href="#"><span class="icon" aria-hidden="true">&#xf006;</span></a>
  
<a class="message-action bp-tooltip" data-bptooltip="I love this" aria-label="I love this" data-status="heart" data-star-nonce="fae1acf32e" data-message-id="6" href="#"><span class="icon" aria-hidden="true">&#xf08a;</span></a>
  
<a class="message-action bp-tooltip" data-bptooltip="Add Comment" aria-label="Add comment" data-status="comment" data-star-nonce="fae1acf32e" data-message-id="6" href="#"><span class="icon" aria-hidden="true">&#xf075;</span></a>

<a class="message-action bp-tooltip" data-bptooltip="Reply" aria-label="Reply" data-status="reply" data-star-nonce="fae1acf32e" data-message-id="6" href="#"><span class="icon" aria-hidden="true">&#xf112;</span></a>

<a class="message-action bp-tooltip" data-bptooltip="Delete" aria-label="Delete this messaage" data-status="remove" data-star-nonce="fae1acf32e" data-message-id="6" href="#"><span class="icon" aria-hidden="true">&#xf00d;</span></a>

<h2>B. SVG Icons in empty links</h2>

<a class="svg-icon bp-tooltip" data-bptooltip="Star this message" aria-label="Star this messaage" data-status="star" data-star-nonce="fae1acf32e" data-message-id="6" href="#">
<svg aria-hidden="true" id="i-star" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="32" height="32" fill="none" stroke="currentcolor" stroke-linecap="round" stroke-linejoin="round" stroke-width="10%">
    <path d="M16 2 L20 12 30 12 22 19 25 30 16 23 7 30 10 19 2 12 12 12 Z" />
</svg></a>

<a class="svg-icon bp-tooltip" data-bptooltip="I love this" aria-label="I love this" data-status="heart" data-star-nonce="fae1acf32e" data-message-id="6" href="#">
<svg aria-hidden="true" id="i-heart" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="32" height="32" fill="none" stroke="currentcolor" stroke-linecap="round" stroke-linejoin="round" stroke-width="10%">
    <path d="M4 16 C1 12 2 6 7 4 12 2 15 6 16 8 17 6 21 2 26 4 31 6 31 12 28 16 25 20 16 28 16 28 16 28 7 20 4 16 Z" />
</svg>
</a>

<a class="svg-icon bp-tooltip" data-bptooltip="Add Comment" aria-label="Add comment" data-status="comment" data-star-nonce="fae1acf32e" data-message-id="6" href="#">
<svg aria-hidden="true" id="i-msg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="32" height="32" fill="none" stroke="currentcolor" stroke-linecap="round" stroke-linejoin="round" stroke-width="10%">
    <path d="M2 4 L30 4 30 22 16 22 8 29 8 22 2 22 Z" />
</svg>
</a>

<a class="svg-icon bp-tooltip" data-bptooltip="Reply" aria-label="Reply" data-status="reply" data-star-nonce="fae1acf32e" data-message-id="6" href="#">
<svg aria-hidden="true" id="i-reply" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="32" height="32" fill="none" stroke="currentcolor" stroke-linecap="round" stroke-linejoin="round" stroke-width="10%">
    <path d="M10 6 L3 14 10 22 M3 14 L18 14 C26 14 30 18 30 26" />
</svg>
</a>

<a class="svg-icon bp-tooltip" data-bptooltip="Delete this Message" aria-label="Delete this message" data-status="delete" data-star-nonce="fae1acf32e" data-message-id="6" href="#">
<svg aria-hidden="true" id="i-close" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="32" height="32" fill="none" stroke="currentcolor" stroke-linecap="round" stroke-linejoin="round" stroke-width="10%">
    <path d="M2 30 L30 2 M30 30 L2 2" />
</svg>
</a>

<h2>C. Icon Fonts in Buttons</h2>

<button type="button" class="message-action bp-tooltip" data-bptooltip="Star this message" aria-label="Star this messaage" data-status="star" data-star-nonce="fae1acf32e" data-message-id="6"><span class="icon" aria-hidden="true">&#xf006;</span></button>
  
<button type="button" class="message-action bp-tooltip" data-bptooltip="I love this" aria-label="I love this" data-status="heart" data-star-nonce="fae1acf32e" data-message-id="6"><span class="icon" aria-hidden="true">&#xf08a;</span></button>
  
<button type="button" class="message-action bp-tooltip" data-bptooltip="Add Comment" aria-label="Add comment" data-status="comment" data-star-nonce="fae1acf32e" data-message-id="6"><span class="icon" aria-hidden="true">&#xf075;</span></button>

<button type="button" class="message-action bp-tooltip" data-bptooltip="Reply" aria-label="Reply" data-status="reply" data-star-nonce="fae1acf32e" data-message-id="6"><span class="icon" aria-hidden="true">&#xf112;</span></button>

<button type="button" class="message-action bp-tooltip" data-bptooltip="Delete" aria-label="Delete this messaage" data-status="remove" data-star-nonce="fae1acf32e" data-message-id="6"><span class="icon" aria-hidden="true">&#xf00d;</span></button>
  
<h2>D. SVG Icons in Buttons</h2>
                                   
<button type="button" class="bp-tooltip svg-icon" data-bptooltip="Star this message" aria-label="Star this messaage"  data-status="star" data-star-nonce="fae1acf32e" data-message-id="6">
<svg aria-hidden="true" id="i-star" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="32" height="32" fill="none" stroke="currentcolor" stroke-linecap="round" stroke-linejoin="round" stroke-width="10%">
    <path d="M16 2 L20 12 30 12 22 19 25 30 16 23 7 30 10 19 2 12 12 12 Z" />
</svg>
</button>

<button type="button" class="bp-tooltip svg-icon" data-bptooltip="I love this" aria-label="I love this" data-status="heart" data-star-nonce="fae1acf32e" data-message-id="6">
<svg aria-hidden="true" id="i-heart" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="32" height="32" fill="none" stroke="currentcolor" stroke-linecap="round" stroke-linejoin="round" stroke-width="10%">
    <path d="M4 16 C1 12 2 6 7 4 12 2 15 6 16 8 17 6 21 2 26 4 31 6 31 12 28 16 25 20 16 28 16 28 16 28 7 20 4 16 Z" />
</svg>
</button>

<button type="button" class="bp-tooltip svg-icon" data-bptooltip="Add Comment" aria-label="Add comment" data-status="comment" data-star-nonce="fae1acf32e" data-message-id="6">
<svg aria-hidden="true" id="i-msg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="32" height="32" fill="none" stroke="currentcolor" stroke-linecap="round" stroke-linejoin="round" stroke-width="10%">
    <path d="M2 4 L30 4 30 22 16 22 8 29 8 22 2 22 Z" />
</svg>
</button>

<button type="button" class="bp-tooltip svg-icon" data-bptooltip="Reply" aria-label="Reply" data-status="reply" data-star-nonce="fae1acf32e" data-message-id="6">
<svg aria-hidden="true" id="i-reply" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="32" height="32" fill="none" stroke="currentcolor" stroke-linecap="round" stroke-linejoin="round" stroke-width="10%">
    <path d="M10 6 L3 14 10 22 M3 14 L18 14 C26 14 30 18 30 26" />
</svg>
</button>

<button type="button" class="bp-tooltip svg-icon" data-bptooltip="Delete this message" aria-label="Delete this messaage" data-status="delete" data-star-nonce="fae1acf32e" data-message-id="6">
<svg aria-hidden="true" id="i-close" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="32" height="32" fill="none" stroke="currentcolor" stroke-linecap="round" stroke-linejoin="round" stroke-width="10%">
    <path d="M2 30 L30 2 M30 30 L2 2" />
</svg>
</button>

<h2>E. Additional Text</h2>

<p>Link: Admin created the group BP Nouveau <a href="#link-to-page" class="bp-tooltip" data-bptooltip="View Discussion" aria-label="View Discussion"><span class="time-since">1 week, 3 days ago</a></p>
<p>Link: <a href="#link-to-page" class="bp-tooltip rss" data-bptooltip="RSS Feed link" aria-label="RSS Feed link">RSS</a></p>
<button type="button" class="bp-tooltip button confirm" href="#link-to-page" data-bptooltip="Delete Conversation" aria-label="Delete Conversation">Delete</button>


<div class="clear"></div>
  
<h2>F. Floated Avatars - img.avatar floated left</h2>
<div class="avatar-block">
	<div class="item-avatar">
		<a href="https://profiles.wordpress.org/johnjamesjacoby" class="bp-tooltip" data-bptooltip="John James Jacoby"><img alt="Profile Photo of John James Jacoby" src="//www.gravatar.com/avatar/7a2644fb53ae2f7bfd7143b504af396c?s=100"></a>
	</div>
	<div class="item-avatar">
		<a href="https://profiles.wordpress.org/boonebgorges" class="bp-tooltip" data-bptooltip="Boone B. Gorges"><img alt="Profile Photo of Boone B. Gorges" src="//www.gravatar.com/avatar/9cf7c4541a582729a5fc7ae484786c0c?s=100"></a>
	</div>
	<div class="item-avatar">
		<a href="https://profiles.wordpress.org/djpaul" class="bp-tooltip" data-bptooltip="Paul Gibbs"><img alt="Profile Photo of Paul Gibbs" src="//www.gravatar.com/avatar/3bc9ab796299d67ce83dceb9554f75df?s=100"></a>
	</div>
	<div class="item-avatar">
		<a href="https://profiles.wordpress.org/r-a-y" class="bp-tooltip" data-bptooltip="Ray"><img alt="Profile Photo of Ray" src="//www.gravatar.com/avatar/3bfa556a62b5bfac1012b6ba5f42ebfa?s=100"></a>
	</div>
	<div class="item-avatar">
		<a href="ttps://profiles.wordpress.org/imath" class="bp-tooltip" data-bptooltip="Mathieu Viet"><img alt="Profile Photo of Mathieu Viet" src="//www.gravatar.com/avatar/8b208ca408dad63888253ee1800d6a03?s=100"></a>
	</div>
	<div class="item-avatar">
		<a href="https://profiles.wordpress.org/mercime" class="bp-tooltip" data-bptooltip="Mercime"><img alt="Profile Photo of Mercime" src="//www.gravatar.com/avatar/fae451be6708241627983570a1a1817a?s=100"></a>
	</div>
	<div class="item-avatar">
		<a href="https://profiles.wordpress.org/dcavins" class="bp-tooltip" data-bptooltip="David Cavins"><img alt="Profile Photo of David Cavins" src="//www.gravatar.com/avatar/a5fa7e83d59cb45ebb616235a176595a?s=100"></a>
	</div>
	<div class="item-avatar">
		<a href="https://profiles.wordpress.org/tw2113" class="bp-tooltip" data-bptooltip="Michael Beckwith"><img alt="Profile Photo of Michael Beckwith" src="//www.gravatar.com/avatar/a5d7c934621fa1c025b83ee79bc62366?s=100"></a>
	</div>
	<div class="item-avatar">
		<a href="https://profiles.wordpress.org/hnla" class="bp-tooltip" data-bptooltip="Hugo Ashmore"><img alt="Profile Photo of Hugo Ashmore" src="//www.gravatar.com/avatar/3860c955aa3f79f13b92826ae47d07fe?s=100"></a>
	</div>
  
</div>
<div class="clear"></div>

<h2>F. Floated Avatars - img div container floated</h2>
<div class="avatar-block">
	<div class="item-avatar-float">
		<a href="https://profiles.wordpress.org/johnjamesjacoby" class="bp-tooltip" data-bptooltip="John James Jacoby"><img alt="Profile Photo of John James Jacoby" src="//www.gravatar.com/avatar/7a2644fb53ae2f7bfd7143b504af396c?s=100"></a>
	</div>
	<div class="item-avatar-float">
		<a href="https://profiles.wordpress.org/boonebgorges" class="bp-tooltip" data-bptooltip="Boone B. Gorges"><img alt="Profile Photo of Boone B. Gorges" src="//www.gravatar.com/avatar/9cf7c4541a582729a5fc7ae484786c0c?s=100"></a>
	</div>
	<div class="item-avatar-float">
		<a href="https://profiles.wordpress.org/djpaul" class="bp-tooltip" data-bptooltip="Paul Gibbs"><img alt="Profile Photo of Paul Gibbs" src="//www.gravatar.com/avatar/3bc9ab796299d67ce83dceb9554f75df?s=100"></a>
	</div>
	<div class="item-avatar-float">
		<a href="https://profiles.wordpress.org/r-a-y" class="bp-tooltip" data-bptooltip="Ray"><img alt="Profile Photo of Ray" src="//www.gravatar.com/avatar/3bfa556a62b5bfac1012b6ba5f42ebfa?s=100"></a>
	</div>
	<div class="item-avatar-float">
		<a href="ttps://profiles.wordpress.org/imath" class="bp-tooltip" data-bptooltip="Mathieu Viet"><img alt="Profile Photo of Mathieu Viet" src="//www.gravatar.com/avatar/8b208ca408dad63888253ee1800d6a03?s=100"></a>
	</div>
	<div class="item-avatar-float">
		<a href="https://profiles.wordpress.org/mercime" class="bp-tooltip" data-bptooltip="Mercime"><img alt="Profile Photo of Mercime" src="//www.gravatar.com/avatar/fae451be6708241627983570a1a1817a?s=100"></a>
	</div>
	<div class="item-avatar-float">
		<a href="https://profiles.wordpress.org/dcavins" class="bp-tooltip" data-bptooltip="David Cavins"><img alt="Profile Photo of David Cavins" src="//www.gravatar.com/avatar/a5fa7e83d59cb45ebb616235a176595a?s=100"></a>
	</div>
	<div class="item-avatar-float">
		<a href="https://profiles.wordpress.org/tw2113" class="bp-tooltip" data-bptooltip="Michael Beckwith"><img alt="Profile Photo of Michael Beckwith" src="//www.gravatar.com/avatar/a5d7c934621fa1c025b83ee79bc62366?s=100"></a>
	</div>
	<div class="item-avatar-float">
		<a href="https://profiles.wordpress.org/hnla" class="bp-tooltip" data-bptooltip="Hugo Ashmore"><img alt="Profile Photo of Hugo Ashmore" src="//www.gravatar.com/avatar/3860c955aa3f79f13b92826ae47d07fe?s=100"></a>
	</div>
  
</div>
<div class="clear"></div>
  




</div><!-- .buddypress-wrap -->

            
          
!
            
              body {
  background-color: #eee;
  font-family: "Lucida Grande", "Lucida Sans", Tahoma, sans-serif;
}

.buddypress-wrap {
  background-color: #fafafa;
  margin: 3em auto;
  padding: 2em 4em;
  width: 500px;
}

h1  {
  color: #990099;
}

h2 {
  font-weight: normal;
  margin: 2em auto 1em;
}

.clear {
  clear: both;
  display: block;
  
}

a {
  color: #990099;
  text-decoration: none;
}

a span.time-since,
a.rss {
  text-decoration: underline;
}

a.message-action {
  height: 20px;
  margin-right: 30px;
  width: 20px;
}

.message-action .icon {
  font-family: FontAwesome;
}

.message-action,
.svg-icon {
  margin-bottom: 30px;
  margin-right: 30px;
}

.svg-icon svg {
  height: 15px;
  width: 15px;
}

button {
  background-color: #eee; 
  border: none;
  color: #000;
  padding: 7px 15px;
  text-align: center;
  text-decoration: none;
}

button:hover,
button:focus {
  background-color: #990099; 
  color: white;
}

.avatar-block {
  width: 400px;
}
/* For F. img floated left changed to inline-block */

.item-avatar {
  float: left;
  margin-right:15px;
  margin-bottom:15px;
}

.item-avatar img{
  display: inline-block;
  border: 3px solid #555;
  border-radius: 50%;  
}

/* For G. only image container is floated left */
.item-avatar-float {
  float: left;
  margin-right:15px;
  margin-bottom:15px;
}

/* Tooltips */
.bp-tooltip {
  position: relative; 
}
.bp-tooltip::after {
    background: #fff;
    border: 1px solid #aaa;
    border-radius: 1px;
    color: #111;
    content: attr(data-bptooltip);
    display: none;
    font-size: 11px; 
    font-weight: normal;
    letter-spacing: normal;
    line-height: 1.5;
    margin-top: 10px;
    opacity: 0;
    padding: 3px 6px;
    position: absolute;
    right: 50%;
    text-align: center;
    text-decoration: none;
    text-shadow: none;
    text-transform: none;
    top: 100%;
    transform: translateX(50%);
    -webkit-transform: translateX(50%);
    white-space: pre;
    word-wrap: break-word;
    z-index: 998;
}

.bp-tooltip::before {
    border: 5px solid transparent;
    bottom: -5px;
    content: "";
    color: #333;
    display: none;
    height: 0;
    margin-right: -5px;
    opacity: 0;
    position: absolute;
    right: 50%;
    top: auto; 
    width: 0;
    z-index: 999;
}

@-webkit-keyframes tooltip-show {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
} 
@keyframes tooltip-show {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.bp-tooltip:hover::before, 
.bp-tooltip:hover::after, 
.bp-tooltip:active::before, 
.bp-tooltip:active::after, 
.bp-tooltip:focus::before, 
.bp-tooltip:focus::after {
    display: inline-block;
    text-decoration: none;
    -webkit-animation-name: tooltip-show;
    animation-name: tooltip-show;
    -webkit-animation-duration: 0.1s;
    animation-duration: 0.1s;
    -webkit-animation-fill-mode: forwards;
    animation-fill-mode: forwards;
    -webkit-animation-timing-function: ease-in;
    animation-timing-function: ease-in;
    -webkit-animation-delay: 0.2s;
    animation-delay: 0.2s;
}
            
          
!
            
              /* Progressive enhancement. JS for mobile touch only. Tooltip shows up on touch start, but does disappear on touch end. */





            
          
!
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