Using a Canvas Element
The default coordinate system has the origin at the top left with the x-axis horizontally and the positive y-axis pointing vertically down the screen. Each unit of the coordinates is one pixel on the screen.
The code that creates the above picture uses three different rectangle drawing functions. The fillRect() function draws a large black square 100 pixels on each side. The clearRect() function then erases a 60x60 pixel square from the center, and then strokeRect() is called to create a rectangular outline 50x50 pixels within the cleared square.