Self-Paced Work: Pixel Updates
Update the grid with some different artwork.
Part 1 - Red PAC-MAN
Instead of yellow, make PAC-MAN red!
- Change the name of the
yellowclass tored- Change the class attribute value for each yellow
<div>in the HTML - Change the
.yellowruleset so that it points to elements with a class ofred
- Change the class attribute value for each yellow
- Change the background color from
goldtoredfor those cells
Part 2 - Smaller PAC-MAN
Make updates so that each pixel in the grid is 50x50 instead of 100x100.
- Set the
widthand theheightof the main<div>to200pxinstead of400px- This is in the
#mainruleset
- This is in the
- Set the
heightof each cell to50pxinstead of100px- This is in the
.cellruleset
- This is in the
Part 3 - Make Your Own Sprite
Instead of PAC-MAN, create a totally different 4x4 pixel art character! Feel free to copy one of the designs from here.
For a good starting point, try recreating one of the Tetris blocks:

- Open the style.css file for editing
- Under the existing contents, create a new class ruleset for each color used in the sprite
- For example, in the long Tetris block, there could be a
.greenselector
- For example, in the long Tetris block, there could be a
- In each color ruleset, set the background color to the appropriate color
- Property:
background - Value: color for the cell
- Property:
- In the HTML file, add an appropriate color class to each
<div>- For example, in the long Tetris block, the third cell in each row could have the
greenclass
- For example, in the long Tetris block, the third cell in each row could have the
Challenge - Make a 5x5 Sprite
It's hard to represent a character in only 32 cells. Instead of using a 4x4 grid, update the code so that it's 5x5. Then, create a new 5x5 sprite using the extra space!

- Open the style.css file for editing
- Update the
#mainruleset to have aheightandwidthof250px - In the
.horizontalrule, update the grid template columns to specify 5 columns instead of 4 - Open the index.html file for editing
- Add an additional "cell"
<div>to each existing "row"<div>- Each new "cell"
<div>should have aclassattribute with valuecell
- Each new "cell"
- Add an additional "row"
<div>as a child of the<div id="main">- The "row"
<div>should have aclassattribute with the valuehorizontal
- The "row"
- Within the new "row"
<div>, add 5 "cell"<div>elements as its children - Update all the classes for the cells to reflect the new sprite
- Try to create a new 5x5 character!
Theoretically, this grid could be as big as is desired... try to make it fit whatever size makes the most sense!