Q
What is the purpose of the viewBox attribute in SVG?

Answer & Solution

Answer: Option A
Solution:
The viewBox attribute in SVG specifies the coordinate system and viewport for scaling and positioning SVG elements within the SVG canvas.
Related Questions on Average

How do you embed an SVG file in an HTML document?

A). Using the <object>element

B). Using the <img> element

C). Using the <svg> element

D). Using the <a> element

What is the purpose of the xmlns attribute in the SVG root element?

A). Defines the XML namespace for SVG elements

B). Specifies the width of the SVG

C). Sets the background color of SVG

D). Defines the border of the SVG

How do you create a path in SVG?

A). Using the <path> element

B). Using the <line> element

C). Using the <circle> element

D). Using the <rect> element

Which CSS property is used to specify the font size of SVG text?

A). font-size

B). text-size

C). size

D). font

What attribute is used to specify the width of an SVG graphic?

A). width

B). height

C). size

D). scale

How do you add text to an SVG graphic?

A). Using the <text> element

B). Using the <label> element

C). Using the <span> element

D). Using the <p> element

Which CSS property is used to specify the color of SVG text?

A). fill

B). color

C). text-color

D). font-color

What is the purpose of the preserveAspectRatio attribute in SVG?

A). Specifies how an SVG image is scaled and positioned within its viewport

B). Sets the background color of SVG

C). Defines the border of the SVG

D). Specifies the version of SVG

How do you create an ellipse in SVG?

A). Using the <ellipse> element

B). Using the <circle> element

C). Using the <path> element

D). Using the <line> element

Which attribute is used to specify the coordinates of a point in SVG?

A). x, y

B). cx, cy

C). r, rx, ry

D). d