Q
How can you apply a linear gradient to a shape in SVG?

Answer & Solution

Answer: Option A
Solution:
A linear gradient can be applied to a shape in SVG using the fill attribute, specifying fill='url(#gradientID)', where gradientID is the ID of the linear gradient defined in the SVG document.
Related Questions on Average

Which element is used to create a radial gradient in SVG?

A). <radialGradient>

B). <linearGradient>

C). <ellipse>

D). <path>

How do you define a linear gradient in SVG using XML syntax?

A). <linearGradient>

B). <radialGradient>

C). <rect>

D). <circle>

How do you specify color stops within an SVG gradient?

A). Using <stop> elements

B). Using elements

C). Using <color> elements

D). Using elements

What does the stop element define in an SVG gradient?

A). Color stop point

B). Starting point of the gradient

C). Ending point of the gradient

D). Direction of gradient

Which attribute specifies the center point of a radial gradient in SVG?

A). cx, cy

B). x1, y1

C). x2, y2

D). r

What is a radial gradient in SVG?

A). A smooth transition radiating outward

B). A gradient along a straight line

C). A solid color fill

D). A pattern fill

How do you apply a radial gradient to a shape in SVG?

A). Using the fill attribute

B). Using the stroke attribute

C). Using the opacity attribute

D). Using the d attribute for paths

How can you define a gradient once and reuse it for multiple elements in SVG?

A). By assigning an ID to the gradient and referencing it in elements

B). By copying the gradient code multiple times

C). By using inline styles for each element

D). By specifying multiple gradients in one element

What is the purpose of the offset attribute in an SVG gradient?

A). Specifies the position of the color stop

B). Specifies the starting point of the gradient

C). Specifies the ending point of the gradient

D). Specifies the direction of the gradient

How is a linear gradient defined in SVG?

A). Using the <linearGradient> element

B). Using the <radialGradient> element

C). Using the <rect> element

D). Using the <circle> element