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

              
                <!DOCTYPE html>
<html lang="de">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
 
    <script src="https://static.codepen.io/assets/common/stopExecutionOnTimeout-de7e2ef6bfefd24b79a3f68b414b87b8db5b08439cac3f1012092b2290c719cd.js"></script>
    <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js'></script>
    <script src='https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js'></script>
 
    <title>Drag & Drop</title>
  </head>

  <body>
    <div class="seite">
         <h1>Überschrift</h1>
      
         <div class="zeile">
            <div class="zelle">Name</div>
            <div class="zelle kopf">01</div>
            <div class="zelle kopf">02</div>
            <div class="zelle kopf">03</div>
            <div class="zelle kopf">04</div>
            <div class="zelle kopf">05</div>
            <div class="zelle kopf">06</div>
            <div class="zelle kopf">07</div>
            <div class="zelle kopf">08</div>
            <div class="zelle kopf">09</div>
         </div>
         <div class="zeile">
            <div class="zelle">G 01</div>
            <div class="zelle DD"></div>
            <div class="zelle DD"></div>
            <div class="zelle DD"></div>
            <div class="zelle DD"></div>
            <div class="zelle DD"></div>
            <div class="zelle DD"></div>
            <div class="zelle DD"></div>
            <div class="zelle DD"></div>
            <div class="zelle DD"></div>
         </div>  
         <div class="zeile">
            <div class="zelle">G 02</div>
            <div class="zelle DD"></div>
            <div class="zelle DD"></div>
            <div class="zelle DD"></div>
            <div class="zelle DD"></div>
            <div class="zelle DD"></div>
            <div class="zelle DD"></div>
            <div class="zelle DD"></div>
            <div class="zelle DD"></div>
            <div class="zelle DD"></div>
         </div> 
     
 
 <div class="normal"> Max und Moritz - Erster Streich  </div>
<div  class="normal lang">Max und Moritz - LANG</div>
  
      <h4>Kopie Container</h4>
      <div id="copybox"></div>
    </div>
  </body>
</html>
              
            
!

CSS

              
                html, body {
  margin:                0;
}

div.seite {
  display:               flex;
  width:                 100%;
  height:                100%;
  flex-direction:column;
}

 

h1{
  height:                100px;
  font-size:             48px;
  text-shadow:           0px 0px 2px #009cff;
  text-align:            center;
}

.zeile {
  padding-top:           4px;
  width:                100%;
  display:flex;
}

.zelle {
  width:                 100px;
  margin-right:          2px;
  height:                30px;
  border-radius:         5px;
  box-shadow:            0px 0px 3px 0px #010101 inset;
}

.kopf {
  width:100px;
  text-align:center;
}

.normal {
  font-size:             100%;
  width:                 304px;
  padding-left:          8px;
  height:                30px;
  background-color:      #ffa500;
  border-radius:         5px;
  box-shadow:            0px 0px 3px 0px #b2b2b2 inset;
  cursor:                pointer;
  overflow:              hidden;
}

.normal:hover {
  background-color:      #F7EA05;
}

.DD.hovering {
  background:            #104e8b;
  border-color:          #000000;
}


.lang {
  width:                 916px;
  background-color:      #fc0000;
}

.normalactive{
  background:green  !important;
  border:2px solid yellow;
}

#copybox{
  width:80%;
  height:100px;
  border:1px solid black;
  overflow:auto;
}
              
            
!

JS

              
                $('.normal').draggable({
    stop: function(ev, ui) {
        clone=$(this).clone();
        $(this).draggable( "destroy" );
        clone.css({
            "position":"static",
            "top":"auto",
            "left":"auto"
        });
        clone.appendTo('#copybox');
    }
});

$('.DD').droppable({
    accept: '.normal',
    hoverClass: 'hovering',
});

document.querySelectorAll('.normal').forEach(el => {
     el.addEventListener('click', function(e) {
           el.contentEditable = true;
           el.classList.add('normalactive');
           el.addEventListener('mouseout', function(e) {
                let classholen=el.hasAttribute('class','normalactive');
                if(classholen==true){
                      el.contentEditable = false;
                      el.classList.remove('normalactive');
                }
           }); 
     });
});
              
            
!
999px

Console