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 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


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.


                <canvas id="html"></canvas>
<iframe id="content" src="" frameborder="0"></iframe>


                * {box-sizing:border-box;}
html, body {margin:0;padding:0;overflow:hidden;background-color:green;text-align:right;}
#html {
 border: 1px solid gray;
 display: block;
 background: transparent;
 z-index: 2;
#content {
 display: inline-block;
 z-index: 1;
 position: absolute;


                var topBar = 75;
var navBar = 200;
var navText = "Navigation";
var fontSize = 20;

function drawSite() {
 // Begin
 const frm = document.querySelector("#content");
 const cvs = document.querySelector("#html");
 const ctx = cvs.getContext("2d");

 /* --> Website Baseplate and Framework <-- */
 cvs.width = window.innerWidth - 2;
 cvs.height = window.innerHeight - 2;
  // Blocks
 ctx.fillStyle = "silver";
 ctx.fillRect(0, 0, cvs.width, topBar);
 ctx.fillRect(0, topBar, navBar, cvs.height - topBar);
  // Borders
 ctx.fillStyle = "gray";
 ctx.fillRect(0, topBar, cvs.width, 1);
 ctx.fillRect(navBar, topBar, 1, cvs.height - topBar);
  // Texts
 ctx.fillStyle = "black";
 ctx.font = fontSize+"px Verdana";
 ctx.fillText(navText, navBar/4, topBar+fontSize+10);
  // iFrame (Fits into the transparent slot of the canvas) = window.innerWidth;
 // End

const timer = setInterval(drawSite, 10);