Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ add another resource


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


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.


Auto Save

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.


                <div class="wrapper">
  <img src=" Assessment_Logo-01.svg" width="200px" alt="Zenyth logo">
  <h1>Accessible Tooltip Pattern</h1>
    <label for="services">Service Options</label>
    <div class="tooltip-wrapper">
    <div id="tooltip" class="tooltip" tabindex="0" role="button" aria-label="Keyboard Instructions" aria-describedby="tooltiptext">
      <i class="fas fa-question-circle" aria-hidden="true"></i>
    <span class="tooltiptext" id="tooltiptext" role="tooltip">Select multiple options by holding crtl + space</span>

    <select multiple name="services[]" class="form-field" id="services" size="4">
      <option value="Website Audit">Website Audit</option>
      <option value="Mobile App Audit">Mobile App Audit</option>
      <option value="Training and Support">Training and Support</option>
      <option value="Compliance Monitoring">Compliance Monitoring</option>
  <h2>WCAG 2.1 AA Tooltip Requirements:</h2>
    <li>Tooltip Text must have role="tooltip"</li>
    <li>Tootlip must display on hover & focus</li>
    <li>Tooltip must be dismissible with ESC key - if it covers any other content on any screen size.</li>
    <li>Tooltip text must be associated with UI control. Use aria-describedby to associate the tooltip with the UI control.</li>
    <li>Tooltip text must be persistently visible while mouse hovers over tooltip text.</li>
  <p>For more information you can reach a friendly accessibility expert at <a href="" target="_blank">Zenyth</a></p>


                * {
  font-style: assistant;
.wrapper {
  margin: 0 auto 2.5em;
  max-width: 600px;
h1 {
  padding-bottom: 25px;
form {
  margin: 0 auto 2.5em;
  max-width: 400px;
label {
  display: inline-block;
  font-weight: bold;
  font-size: 1.2em;
select {
  display: block;
  overflow-y: hidden;
  width: 50%;
select option {
  padding: 3px;
#tooltip {
  position: relative;
  display: inline-block;

.tooltiptext {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(100% + 2px);
  width: 200px;
  background-color: #5b616b;
  border-radius: 6px;
  padding: 8px 14px 8px 3px;
  font-size: 14.5px;
  line-height: 1.8;
  font-family: "Open Sans", sans-serif;
  color: #fff;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s;
  z-index: 1;

.tooltiptext.visible {
  opacity: 1;
  visibility: visible;
.tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #555 transparent transparent transparent;
.close-btn {
  position: absolute;
  top: 4px;
  right: 0px;
  display: inline-block;
  margin-right: 3px;
  border: none;
  background: transparent;
  color: #fff;

.tooltip-wrapper button:focus-visible {
    outline-color: #5490eb !important;
    outline-style: auto !important;
    outline-offset: 4px !important;
    outline-width: 4px !important;

.tooltip-wrapper {
  position: relative;
  display: inline-block;



                $(document).ready(() => {
  // Show the tooltip on hover of .tooltip-wrapper
  $(".tooltip-wrapper").on("mouseenter", function () {
    const tooltiptext = $(this).find(".tooltiptext");

  // Hide the tooltip when leaving .tooltip-wrapper
  $(".tooltip-wrapper").on("mouseleave", function () {
    const tooltiptext = $(this).find(".tooltiptext");

  // Leave the existing focus and blur functions for keyboard navigation
  $(".tooltip").on("focus", function () {
    const tooltip = $(this).next(".tooltiptext");

  $(".tooltip").on("blur", function () {
    const tooltip = $(this).next(".tooltiptext");
  // Dismiss the tooltip when the Escape key is pressed
  $(document).on("keyup", function (event) {
    if (event.key === "Escape") {
      const visibleTooltip = $(".tooltiptext.visible");
      if (visibleTooltip.length > 0) {