HTMLcopy
1
<div id="container"></div>
CSScopy
6
1
html, body, #container {
2
width: 100%;
3
height: 100%;
4
margin: 0;
5
padding: 0;
6
}
JavaScriptcopy
x
1
var stage = acgraph.create('container');
2
3
var greenRect = stage.rect(10, 10, 100, 100);
4
greenRect.fill('#A5D6A7');
5
6
// Gets width.
7
var width = greenRect.getWidth();
8
9
var redRect = stage.rect(10, 10, width, 50);
10
redRect.fill('#EF9A9A');