Due 10-04 (7 days)
2016-SWC/ps-03/index.html
.ps-03
).ps-03-starter.html
to your 2016-SWC/ps-03/
folder called 'squares.html'squares.css
using a <link rel="stylesheet" href= …
tag.squares.js
. By placing a <script type="text/javascript" src="squares.js" …
tag sometime after the canvas
tag. This can be tricky.Modify the HTML or CSS from any of your ps-02 solutions to improve layout & styling.
To complete item 'c' here, you may want to review the MDN Canvas API
ps-03-starter.html
to a new file.canvas
object.<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>canvas starter document</title>
<style media="screen">
body {
font-family: 'helvetica', sans-serif;
display: flex;
align-items: center;
justify-content: center;
position: fixed;
top: 0px;
bottom: 0px;
left: 0px;
right: 0px;
}
canvas {
border: 1px solid hsl(0,10%,90%);
width: auto;
height: 50%;
}
</style>
</head>
<body>
<canvas id="canvas" width="500" height="500"></canvas>
</body>
<script type="text/javascript">
var canvas = document.getElementById('canvas');
var drawingPad = canvas.getContext('2d');
drawingPad.fillStyle = "hsla(0,10%,10%,1)";
drawingPad.fillRect(0, 0, 20, 20);
</script>
</html>