<svg width="160" height="140" xmlns="http://www.w3.org/2000/svg">
<rect
x="10"
y="10"
width="100"
height="100"
stroke="blue"
fill="purple"
fill-opacity="0.5"
stroke-opacity="0.8"
stroke-width="15" />
</svg>Fills and strokes / notebook
Fills and strokes
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
<svg width="400" height="180" xmlns="http://www.w3.org/2000/svg">
<polyline
points="40 80 80 40 120 80"
stroke-width="15"
stroke="black"
fill="coral"
paint-order="fill" />
<polyline
points="40 140 80 100 120 140"
stroke-width="15"
stroke="black"
fill="coral"
paint-order="stroke" />
</svg>#MyRect:hover {
stroke: black;
fill: blue;
}#MyRect {
fill: red;
stroke: black;
}