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.


                <!DOCTYPE html>
  <link rel="stylesheet" type="text/css" href="style.css">
<script src=""></script>
  <div id="container">
    <br />
 <div id="Btns">
      <button id="recreate" onclick="resizeGrid(this.value)">remake grid</button>
  <script src="script.js"></script>



added the container that holds the grid to manipulate the css.
made it appear more like the etch-a-sketch board.

width: 25.25%;

#container {
  width: 50%;
  height: 50%;
  margin-left: auto;
  margin-right: auto;
  background: "white";
  box-sizing: border-box;


there is a bit of extra space being generated on the right side of the grid.
row seems to be causing the issue will need to review.
Checked the grid creation which seems to be fine.
 line-height: 0;

.row:first-child .box {
    border-top: 1px solid red; 

  display: inline-block;
  width: 15px;
  height: 15px;
  border: 1px solid red;
  box-sizing: border-box;
  margin: 0;

.box: first-child{
  border-left: 1px solid red;



                //try flexbox
adding a button and having the submit grab the value for the backend function

//trying to make a function for creating divs
window.onload = function(){
  var createGrid = prompt("How many rows do you want?");
  for(i = 0; i < createGrid; i++){
    var row = document.createElement('div');
      row.className = "row"; = "row" + i;
  for(k= 0; k < createGrid; k++ ){
    var box = document.createElement('div');
      box.className = "box";
        return container;

//create a grid
//generates a grid with the original div container already on index.html you need to start messing with the code you work with to gain a better understanding of what it's doing
function grid() {
  var container = document.getElementById("container");
        for (i = 0; i <= 16; i++){
     for(k = 0; k <= 16; k ++){
          var box = document.createElement("div");
           box.className = "box";
         //    row.appendChild(box);
           return container;
         // grid(document.body);

function resizeGrid(){
  //missing a clear grid function!
  //right now the resizing is adding to the bottom of the old grid.
  function clearGrid(){
  } = "#3d3d3d";