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.


                <script src=""></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 =;
    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: + document.body.scrollTop

        var top_offset = - 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: + document.body.scrollTop

            var actualY = e.pageY - wpoffset;
            var top_offset = - 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
   = eheight + "px";
   = 1;
            // Trigger ace editor resize()

            window.draggingAceEditor[id_editor] = false;

    document.addEventListener("mouseup", action_mouseup);