css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

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.


    <title>FEWD Pixel Art Maker</title>
    <link href="https://fonts.googleapis.com/css?family=Lobster|Macondo|Open+Sans+Condensed:700" rel="stylesheet">
    <link rel="stylesheet" href="styles.css">
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>

    <h1>Pixel Art Maker by Lara!</h1>

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

    <h2>Select A Colour</h2>
    <input type="color" id="colorPicker">

    <div id= "whiteboard"> 
    <h2>Make Pixel Art!</h2>
    <h3>Click to paint. Double-click to delete.</h3>
    <table id="pixel_canvas"></table>
    <script src="designs.js"></script>
              body {
    text-align: center;
    /*background: url(img/background_1.png) no-repeat center center fixed;*/
    /*background-size: cover;*/
    /*color: #FFFACD    ;*/
    color: #4169E1;


h1 {
    font-family: Lobster, cursive;
    font-size: 90px;
    margin: 0.5em;
    text-shadow: 2px 2px 5px #FF0000;


h2 {
    font-family: Macondo, cursive;
    margin: 1em 0 0.25em;

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

h3 {

    font-family: Open Sans Condensed;
    margin-top: -0.2em;


td {
    border: 1px solid black;

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

tr {
    height: 20px;

td {
    width: 20px;

input[type=number] {
    width: 6em;

#sizePicker, #button {
    font-family: Macondo, cursive;
    font-size: 17px;
    font-weight: bold;
    margin: 0.3em;

#whiteboard {
    padding: 5px;
    background-color: #ffffff;
    border: 2px black;
    max-height: 50%;
    max-width: 50%;
    margin: 0 auto;
              //declare constants
const sizePicker = $('#sizePicker');
const pixelCanvas = $('#pixel_canvas');

function makeGrid() {
  let grid; //create let variable where tr/td will be generated
  pixelCanvas.find('tr').remove(); // will delete existing grid if any 

 let totalGrid = { //create an Object to contain the submitted values of height and width 
  height: $('#input_height').val(), 
  width: $('#input_width').val()

//Create the grid
  for (let i = 0; i < totalGrid.height; i++ ){
    grid += '<tr>'; //add row
    for (let j = 0; j < totalGrid.width; j++) {
      grid += '<td></td>'; //add column
    grid += '</tr>'; //close row
 pixelCanvas.html(grid); //fill the canvas

pixelCanvas.on('click', 'td', function () { //Add colour to the pixel when clicking
  var color = $('#colorPicker').val(); //set a var to store current colour
  $(this).css('background-color', color); //paint pixel with CSS 'background-color'

pixelCanvas.on('dblclick', 'td', function () { //Remove colour on double click (by painting white)
  $(this).css('background-color', '#ffffff');

sizePicker.on('submit', function(e){ //call the function on clicking 'submit'

///// TODO1: add function for painting on drag
///// TODO2: add function to remove on drag (dependant on dblclick or other event?)
///// TODO3: add function to clear table
///// TODO4: add function to save as image
///// TODO5: style with CSS (partially completed 100118)
🕑 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.
Loading ..................