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.


    <title>Pixel Art Maker!</title>
    <link rel="stylesheet" href="">
    <link rel="stylesheet" href="styles.css">
    <meta charset="UTF-8">
    <script src=""></script>
    <link rel="stylesheet" href="">
    <link rel="stylesheet" href="">
    <h1>Lab: Pixel Art Maker</h1>

    <h2>Choose Grid Size</h2>
    <form id="sizePicker">
        Grid Height:
        <input type="number" id="input_height" name="height" min="1" max="100" value="1">
        Grid Width:
        <input type="number" id="input_width" name="width" min="1" max="100" value="1">
        <input type="submit" id="button">

    <h2>Pick A Color</h2>
    <input type="color" id="colorPicker" value="#6495ed">

    <h2>Design Canvas</h2>
    <table id="pixel_canvas"></table>
    <script src="designs.js"></script>



                body {
    text-align: center;
    background-color: BlanchedAlmond;

h1 {
    font-family: Monoton;
    font-size: 70px;
    margin: 0.2em;
    color: #2B6FE9;

h2 {
    margin: 1em 0 0.25em;

h2:first-of-type {
    margin-top: 0.5em;

td {
    border: 1px solid black;

table {
    border-collapse: collapse;
    margin: 0 auto;

tr {
    height: 20px;

td {
    width: 20px;

input[type=number] {
    width: 6em;
    color: cornflowerblue;
    border-radius: 8px;
    font-size: 110%;



                //function to make sure it loads after html 

function makeGrid() {    //set vars inside makeGrid so no parameters
  const height=$('#input_height').val();  
  const width=$('#input_width').val();
  const table=$('#pixel_canvas');
  const colour=$('#colorPicker');
  table.children().remove(); //removes any grid created previously
  for (let r=0; r<height; r++) {  //loops for creating grid
    for (let c=0; c<width; c++) {  
      $('tr').last().append('<td></td>'); //adds new cells to last rows
  table.on('click', 'td', function(){  //listens to clicks on created table and colours tds
      $(this).css('background-color', colour.val());

$("#button").click(function(evt) { //calls the function makeGrid
  evt.preventDefault();  //prevents reloading page with submit button