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="w-layout-grid drag-grid">
    <div id="pompelmo" class="draggable" style="position: relative; left: 700px; top: 140px;">
        <img src="" alt="" class="card-img pompelmo" style="width: 160px; height: auto;">
    <div id="untersetzer" class="draggable" style="position: relative; left: 120px; top: 200px;">
        <img src="" class="card-img untersetzer" style="width: 280px; height: auto;">
    <div id="teller" class="draggable" style="position: relative; left: 360px; top: -150px;">
        <img src="" class="card-img teller" style="width: 380px; height: auto;">
    <div id="tarte" class="draggable" style="position: relative; left: -290px; top: -847px;">
        <img src="" alt="" class="card-img tarte" style="width: 100px; height: auto;">
    <div id="diving" class="draggable" style="position: relative; left: 150px; top: -700px;">
        <img src="" class="card-img diving" style="width: 190px; height: auto;">


    /* Stil für den Drag-and-Drop-Container */
    .drag-grid {
        position: relative;
        width: 100%;

    /* Stil für draggbare Elemente */
    .draggable {
        position: absolute;
        cursor: pointer;

    /* Stil für die Bilder */
    .card-img {
        max-width: 100%;
        height: auto;

    /* Hover-Effekt mit 3° Drehung */
    .draggable:hover {
        transform: rotate(3deg);
        transition: transform 0.3s ease;

    /* Responsive Verhalten: Drag-and-Drop auf mobilen Geräten deaktivieren */
    @media (max-width: 768px) {
        .draggable {
            display: none;


document.addEventListener('DOMContentLoaded', function() {
    document.querySelectorAll('.draggable').forEach(el => {
        el.addEventListener('mousedown', function(e) {
            // Berechnen Sie den Abstand vom linken und oberen Rand des Elements
            var offsetX = e.clientX - el.getBoundingClientRect().left;
            var offsetY = e.clientY - el.getBoundingClientRect().top;

            function mouseMoveHandler(e) {
                // Setzen Sie die Position des Elements auf die Mausposition minus den berechneten Abstand
       = (e.clientX - offsetX) + 'px';
       = (e.clientY - offsetY) + 'px';

            function reset() {
                // Entfernen Sie die Event-Listener, wenn die Maus losgelassen wird
                window.removeEventListener('mousemove', mouseMoveHandler);
                window.removeEventListener('mouseup', reset);

            // Fügen Sie Event-Listener für Mausbewegung und Mausloslassen hinzu
            window.addEventListener('mousemove', mouseMoveHandler);
            window.addEventListener('mouseup', reset);