HTML Graphics: Prepared by Shahzeb Khan
HTML Graphics: Prepared by Shahzeb Khan
HTML Graphics: Prepared by Shahzeb Khan
</svg>
SVG Line
• The <line> element is used to create a line:
• The x attribute defines the left position of the rectangle (e.g. x="50"
places the rectangle 50 px from the left margin)
• The y attribute defines the top position of the rectangle (e.g. y="20"
places the rectangle 20 px from the top margin)
• The width and height attributes of the <rect> element define the
height and the width of the rectangle
SVG Polygon
• Polygon comes from Greek. "Poly" means "many" and "gon" means
"angle".
• The <polygon> element is used to create a graphic that contains at
least three sides. Polygons are made of straight lines, and the shape is
"closed“. The following code draws a triangle (three-sided figure):
• The points attribute defines the x and y coordinates for each corner of
the polygon.
• These points are separated by a space e.g. 200,10 is one point and so on.
SVG Polyline
• The <polyline> element is used to create any shape that consists of
only straight lines (that is connected at several points):