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

              
                


<!-- this div is the draggable element-->
<h1 class="draggable">Drag me</h1>

<div class="draggable">

  <p><span class="bigtype">
Reading Level 999</span>

  </p>
</div>
<!-- end of the draggable element -->  

<!-- start of a div that's a simple stage in the center, in relative position -->  

<div id="wrapper" >
 <h1>In a memo to staff yesterday, old man Murdoch announced the change and said his son Lachlan is “absolutely committed to the cause” of “freedom” and will continue Fox’s legacy. Rupert had signaled this would be the ultimate succession plan when he named Lachlan CEO of Fox News in 2019.</h1>
<h1>
But the hardest part is not over. Lachlan is inheriting an empire riddled with gas fires that no one has a thick enough towel to put out. In April, Fox agreed to pay Dominion Voting Systems $787.5 million to settle a defamation lawsuit—the largest known media defamation settlement in US history. And there’s a similar lawsuit from another voting tech company still percolating, as well as two lawsuits from Fox shareholders alleging that company directors, including Rupert and Lachlan, failed to perform their duties by getting the company caught up in defamation cases. Phew.
</h1>
  
   
  
  
<h1>
Plus, the succession drama is just getting started. After Rupert’s death, his shares will be divided among Lachlan and three of his five siblings—Elisabeth, James, and Prudence. And, based on previous brotherly tension between James and Lachlan, the top job could still be up for grabs.—MM
</h1>
</div>
              
            
!

CSS

              
                /*this is the  class that hovers on top of everything*/ 
.draggable {
  
 position: fixed;
top:430;
  padding:10px;
  left:0;
  overflow:hidden;
cursor: grab !important;
}



.bigtype{
  font-family: sans-serif;
   font-size:10vw; 
  color:red;
  font-weight:700;
line-height:100%;
}

h1{
  font-family:Georgia;
  font-weight:500;
  font-size:35px;
  line-height:43px;
  margin:30px 10px;
 }



#wrapper{
 margin:30px auto;
  width:550px;
  border:1px solid black;
  
  
}
              
            
!

JS

              
                // the ui-resizable-handles are added here
$('.resizable').resizable();

// makes GSAP Draggable avoid clicks on the resize handles
$('.ui-resizable-handle').attr('data-clickable', true);

// make the element draggable
Draggable.create('.draggable');
              
            
!
999px

Console