Week 9 - Task 2a

Making "pixels"

HTML

Make a div container element that will hold all the "pixels"

Javascript

Use a for-loop to add X (variable) number of "pixels (div) horisontaly.

Hint: When you generate the html for the "pixels" in the for-loop add a class you can use to style them with

CSS

Create some styling for the class used by the "pixels" above. Use these CSS properties:

height width border margin background-color

Hint: Also add display: inline-block; to this class. This will keep the "pixels" on the same line.

Example of how it might look like