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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation


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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

              <script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.4.6/ace.js"></script>

<div id="editor1_wrapper" class="app_editor_wrapper">
	<div id="editor1" class="app_editor">echo "Hello";</div>
	<div id="editor1_dragbar" class="app_editor_dragbar"></div>
<div id="editor2_wrapper" class="app_editor_wrapper">
	<div id="editor2" class="app_editor">echo "Hello 2";</div>
	<div id="editor2_dragbar" class="app_editor_dragbar"></div>
              body {
  margin: 40px;

.app_editor {
  height: 300px;

.app_editor_wrapper {
	background-color: #cccccc;
	border-bottom: 1px solid #222222;

.app_editor_dragbar {
	background-color: #222222;
	width: 100%;
	height: 2px;
	cursor: row-resize;
	opacity: 1;
              var aceEditorInstance = ace.edit( "editor1" );
var aceEditorInstance2 = ace.edit( "editor2" );

// inline must be true to syntax highlight PHP without opening <?php tag
aceEditorInstance.getSession().setMode( { path: "ace/mode/php", inline: true } );

// inline must be true to syntax highlight PHP without opening <?php tag
aceEditorInstance2.getSession().setMode( { path: "ace/mode/php", inline: true } );

 * Global variable to store the ids of the status of the current dragged ace editor.
window.draggingAceEditor = {};

function makeAceEditorResizable(editor){
    var id_editor = editor.container.id;
    var id_dragbar = id_editor + '_dragbar';
    var id_wrapper =  id_editor + '_wrapper';
    var wpoffset = 0;
    window.draggingAceEditor[id_editor] = false;

    var action_mousedown = function(e) {

        window.draggingAceEditor[id_editor] = true;

        // Set editor opacity to 0 to make transparent so our wrapper div shows
        document.getElementById(id_editor).style.opacity = 0;
        document.addEventListener("mousemove", action_document_mousemove);

    var action_document_mousemove = function(e){
        var _editor = document.getElementById(id_editor);
        var rect = _editor.getBoundingClientRect();

        var rsl = {
            top: rect.top + document.body.scrollTop

        var top_offset = rsl.top - wpoffset;

        var actualY = e.pageY - wpoffset;

        // editor height
        var eheight = actualY - top_offset;
        // Set wrapper height
        document.getElementById(id_wrapper).style.height = eheight;
        // Set dragbar opacity while dragging (set to 0 to not show)
        document.getElementById(id_dragbar).style.opacity =  0.15;

    document.getElementById(id_dragbar).addEventListener("mousedown", action_mousedown);
    var action_mouseup = function(e){
        if (window.draggingAceEditor[id_editor])
            var ctx_editor = document.getElementById(id_editor);
            var rect = ctx_editor.getBoundingClientRect();

            var rsl = {
                top: rect.top + document.body.scrollTop

            var actualY = e.pageY - wpoffset;
            var top_offset = rsl.top - wpoffset;
            var eheight = actualY - top_offset;
            document.removeEventListener("mousemove", action_document_mousemove);
            // Set dragbar opacity back to 1
            document.getElementById(id_dragbar).style.opacity = 1;
            // Set height on actual editor element, and opacity back to 1
            ctx_editor.style.height = eheight + "px";
            ctx_editor.style.opacity = 1;
            // Trigger ace editor resize()

            window.draggingAceEditor[id_editor] = false;

    document.addEventListener("mouseup", action_mouseup);


🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.