Pen Settings

HTML

CSS

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

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

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.

HTML

              
                <!DOCTYPE html>
<html lang="de">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Benutzerdefinierter Tooltip</title>
</head>
<body>
  <h1>Hier gibts jetzt ein Tooltip-Beispiel</h1>
<p>Das 2025 in Kraft tretende <abbr class="tooltip" aria-label="Barrierefreiheitsstärkungsgesetz">BFSG<span class="tooltiptext" role="tooltip">Barrierefreiheitsstärkungsgesetz</span></abbr> ist ein wichtiges Gesetz.</p>

</body>
</html>
              
            
!

CSS

              
                /* Achtung: Die fixe Angabe der Tool-Tip-Breite in Pixeln ist nicht optimal, sondern funktioniert nur mit diesem Beispiel. Ich habe mich nicht damit auseinander gesetzt, eine für jede Tool-Tip-Länge passende CSS-Lösung zu schreiben. */

body {font-family: Arial, Helvetica, sans-serif;} 
h1 {font-size:2.5em;}
p {font-size:1.5em;}

abbr {border-bottom: 1px dotted #000;}

.tooltip {
      position: relative;
      display: inline-block;
      cursor: pointer;
    }

    .tooltip .tooltiptext {
      visibility: hidden;
      width: 350px;
      background-color: darkgreen;
      color: #fff;
      text-align: center;
      border-radius: 6px;
      padding: 5px 3px;
      position: absolute;
      z-index: 1;
      bottom: 125%; /* Positionierung des Tooltips über dem Text */
      left: 0%;
      margin-left: -150px;
      opacity: 0;
      transition: opacity 0.3s;
    }

    .tooltip .tooltiptext::after {
      content: "";
      position: absolute;
      top: 100%;
      left: 50%;
      margin-left: -5px;
      border-width: 5px;
      border-style: solid;
      border-color: black transparent transparent transparent;
    }

    .tooltip:hover .tooltiptext {
      visibility: visible;
      opacity: 1;
    }
              
            
!

JS

              
                
              
            
!
999px

Console