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


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.


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.


                <!DOCTYPE html>
  <title>My First Theory Block</title>
  <meta charset="utf-8"/>
  <link rel="stylesheet" href="">
  <link href="" rel="stylesheet">
  <script src=""> </script>
  <body onload="init()"> <!--No entiendo para que sirve "init()" -->
    <h1 id="mainTitle" >Haciendo los objetos arrastrables</h1>
   <p>La característica de arrastrar y soltar le permite "agarrar" un objeto y arrastrarlo a un lugar diferente. Para hacer un elemento arrastrable, sólo establece el atributo <b>draggable</b> a verdadero: </p>   
    <pre class="prettyprint lang-html">  
&nbsp&nbsp<i class="material-icons">&#xe86f;</i>
      &ltimg draggable="true"&gt 


      <p class="keyinfo">  <br>&nbsp&nbsp&nbsp&nbsp<i style="font-size:24px" class="fa">&#xf05a;</i>
 &nbsp Cualquier elemento HTML puede ser arrastrable <br><br>  </p>
      <p>La API para arrastrar y soltar en HTML está basada en eventos.</p>
     <label class="codelabel">
       <p class="codep">
      <code> <br>&nbsp&nbsp<i class="material-icons">&#xe86f;</i>&nbsp&nbsp&lt!DOCTYPE HTML&gt<br>
      &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&lthtml&gt<br>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&lthead&gt ...
         <br><br></code> </p>
    <h3>Qué arrastrar</h3>
      <p>Cuando el elemento es arrastrado, el atributo <b>ondragstart</b> llama a una función, drag(event), que especifica qué información será arrastrada. El método <b>dataTransfer.setData()</b>  establece el tipo de datos y el valor de los datos arrastrados.</p>
      <p class="codep">
      <code class="code"> <br>&nbsp&nbsp<i class="material-icons">&#xe86f;</i>&nbsp&nbspfunction drag(ev){
        ev.dataTransfer.setData("text",;} <br><br> </code> </p>
     <p>En nuestro ejemplo, el tipo de datos es "texto" y el valor es el ID del elemento arrastrable ("imagen")



                /*.code{ background: #ADD8E6}*/
.keyinfo{ background: orange}
h3{text-decoration: underline}