May 2019
Beginner to intermediate
650 pages
14h 50m
English
Shapes have default black fill colors and transparent stroke borders, unless you assign different color strings to the SVG attributes (or CSS properties) fill and stroke.
In the following SVG, three straight lines were drawn using the mandatory x1/y1 and x2/y2 attributes for <line> elements. They would be invisible it the stroke attribute wasn't present. A stroke-width has a default value of 1.
<svg width="400" height="300"> <line x2="400" stroke="red" stroke-width="5"/> <line y2="150" stroke="blue" stroke-width="5"/> <line x2="200" y2="150" stroke="black" stroke-width="1"/></svg>
As before, missing attributes use zero as default, so x1 and y1 are zero in all lines, which makes them all start at the top-left corner, which ...
Read now
Unlock full access