Docsity

(Intermediate HTML & CSS) SVG Knowledge Assessment Guide 2024, Exams of Computer Science

Partial preview of the text

Download (Intermediate HTML & CSS) SVG Knowledge Assessment Guide 2024 and more Exams Computer Science in PDF only on Docsity!

INTERMEDIATE HTML & CSS

SVG

KNOWLEDGE ASSESSMENT GUIDE

  1. Multiple Choice: Which attribute in SVG can be used to apply visual effects such as blurring or color adjustments? A. stroke-opacity B. filter C. transform D. fill

Correct Answer: B. filter

Rationale: The filter attribute in SVG allows for the application of visual effects such as blurring or color adjustments to elements within the SVG.

  1. Fill-in-the-Blank: The element in SVG requires the attributes ___ and ___ to specify the circle's center point and radius.

Correct Answer: cx, cy, r

Rationale: The cx and cy attributes specify the center point of the circle, while the r attribute specifies the radius of the circle.

  1. True/False: In SVG, the text content within the element is not selectable by default.

Correct Answer: True

Correct Answer: True

Rationale: The element in SVG allows for referencing and reusing existing SVG elements, enabling efficient reuse of content within the same document.

  1. Multiple Choice: Which SVG element is used to create complex shapes and paths by combining simpler shapes? A. B. C. D.

Correct Answer: B.

Rationale: The element in SVG is used to create complex shapes and paths by defining a series of path commands.

  1. Fill-in-the-Blank: The attribute ____ in SVG is used to define the transparency of an element's fill or stroke.

Correct Answer: opacity

Rationale: The opacity attribute in SVG specifies the transparency of an element's fill or stroke, with a value between 0 (fully transparent) and 1 (fully opaque).

  1. True/False: The viewBox attribute in SVG is used to define the coordinate system for the SVG element.

Correct Answer: True

Rationale: The viewBox attribute in SVG defines the coordinate system and dimensions of the SVG content, allowing for scaling and positioning within the SVG viewport.

  1. Multiple Choice: Which attribute in SVG is used to apply transformations such as scaling, rotating, or skewing to elements? A. position B. scale C. transform D. rotate

Correct Answer: C. transform

Rationale: The transform attribute in SVG allows for applying transformations such as scaling, rotating, skewing, and translating elements.

  1. Fill-in-the-Blank: The attribute ____ in SVG is used to specify the width of strokes around shapes and paths.
  1. Fill-in-the-Blank: The attribute ____ in SVG is used to define the rotation angle of an element.

Correct Answer: rotate

Rationale: The rotate attribute in SVG specifies the rotation angle of an element, allowing for the rotation of shapes or text within an SVG image.

  1. True/False: In SVG, the element is used to group multiple SVG elements together, providing a convenient way to apply transformations or styles to the entire group.

Correct Answer: True

Rationale: The element in SVG is used to group multiple SVG elements together, enabling easy application of transformations or styles to the entire group.

  1. Multiple Choice: Which SVG element is used to define custom shapes based on a series of points and commands? A. B. C. D.

Correct Answer: C.

Rationale: The element in SVG is used to define custom shapes based on a series of points and path commands, providing flexibility in creating complex shapes.

  1. Fill-in-the-Blank: The attribute ____ in SVG is used to specify the pattern for dashed lines along the strokes of shapes or paths.

Correct Answer: stroke-dasharray

Rationale: The stroke-dasharray attribute in SVG defines the pattern for dashed lines along the strokes of shapes or paths, allowing for the creation of dashed stroke effects.

  1. True/False: The viewBox attribute in SVG is required for all SVG elements to define the aspect ratio of the SVG image within its viewport.

Correct Answer: False

Rationale: The viewBox attribute in SVG is optional and not required for all SVG elements, but it is commonly used to define the coordinate system and aspect ratio of the SVG image within its viewport.

  1. Multiple Choice: Which attribute in SVG is used to define the outline color of shapes and paths? A. fill B. stroke C. outline

A. B. C. D.

Correct Answer: A.

Rationale: The element in SVG is used to create gradient fills that transition smoothly from one color to another along a straight line.

  1. Fill-in-the-Blank: The attribute ____ in SVG is used to define the size of text elements within an SVG image.

Correct Answer: font-size

Rationale: The font-size attribute in SVG specifies the size of text elements within an SVG image, allowing for customization of text size.

  1. True/False: The element in SVG is used to create animations by defining keyframes and animation properties.

Correct Answer: True

Rationale: The element in SVG is used to create animations by defining keyframes, animation properties, and values to animate SVG elements.

  1. Multiple Choice: Which attribute in SVG is used to control the visibility of elements within an SVG image? A. visibility B. display C. show D. hide

Correct Answer: A. visibility

Rationale: The visibility attribute in SVG is used to control the visibility of elements within an SVG image, allowing for toggling element visibility.

  1. Fill-in-the-Blank: The attribute ____ in SVG is used to define the alignment of text content within a text element.

Correct Answer: text-anchor

Rationale: The text-anchor attribute in SVG defines the alignment of text content within a text element, allowing for alignment options such as start, middle, or end.

  1. True/False: The element in SVG is used to define clipping paths that hide portions of elements based on defined shapes.

Correct Answer: True

  1. True/False: The element in SVG is used to apply image effects such as blurring, sharpening, or color adjustments to SVG elements.

Correct Answer: True

Rationale: The element in SVG is used to apply image effects such as blurring, sharpening, or color adjustments to SVG elements, allowing for creative visual effects in SVG images. Which attribute in SVG is used to define the horizontal position of an element relative to the x-axis? A) y B) cx C) x D) rx

Correct Answer: C) x

Rationale: The x attribute in SVG is used to define the horizontal position of an element relative to the x-axis. What does the viewBox attribute in SVG define? A) The color of the element B) The visible area of the SVG canvas C) The stroke width of the element

D) The rotation angle of the element

Correct Answer: B) The visible area of the SVG canvas

Rationale: The viewBox attribute in SVG defines the visible area of the SVG canvas. Which SVG element is used to create a rectangle? A) B) C) D)

Correct Answer: B)

Rationale: The element in SVG is used to create a rectangle. Fill-in-the-Blank Questions: The _ attribute is used to define the vertical position of an element relative to the y-axis.

Correct Answer: y

Rationale: The y attribute in SVG is used to define the vertical position of an element relative to the y-axis.

Correct Answer: False

Rationale: The fill attribute in SVG is used to define the color filling inside an SVG element, not the color of the stroke around it.

  1. Which SVG element is used to define a gradient?
    • a) ``
    • b) ``
    • c) Both a and b
    • d) ``
    • Answer: c) Both a and b
    • Rationale: Both and are used to define gradients in SVG.
  2. What attribute is used to define the path data in an SVG `` element?
    • a) d
    • b) path
    • c) data
    • d) points
    • Answer: a) d
    • Rationale: The d attribute contains the path data, which defines the shape of the path.
  1. Which of the following is NOT a valid SVG shape element?
    • a) ``
    • b) ``
    • c) ``
    • d) ``
    • Answer: d) ``
    • Rationale: The correct SVG element for a rectangle is , not.
  2. What does the viewBox attribute in SVG specify?
    • a) The position and dimension of the SVG viewport
    • b) The color of the SVG elements
    • c) The stroke width of the SVG elements
    • d) The fill pattern of the SVG elements
    • Answer: a) The position and dimension of the SVG viewport
    • Rationale: The viewBox attribute defines the coordinate system and dimensions of the SVG viewport.
  3. Which SVG element is used to group other SVG elements?
    • a) ``
    • b) ``
    • c) ``
  1. The ________ attribute is used to define the outline color of an SVG element.
    • Answer: stroke
    • Rationale: The stroke attribute specifies the color of the outline of an SVG element.
  2. The ________ element in SVG is used to define reusable graphical objects.
    • Answer: ``
    • Rationale: The element is used to define reusable graphical objects that can be referenced by elements.

True/False Questions

  1. The `` element in SVG is used to reference and reuse an existing SVG element.
    • Answer: True
    • Rationale: The `` element allows for the reuse of existing SVG elements by referencing them.
  2. SVG stands for Scalable Vector Graphics.
    • Answer: True
    • Rationale: SVG is an acronym for Scalable Vector Graphics, a language for describing 2D graphics in XML.
  1. The stroke-width attribute in SVG defines the width of the fill color.
    • Answer: False
    • Rationale: The stroke-width attribute defines the width of the stroke (outline), not the fill color.
  2. The `` element in SVG is used to define elements that can be reused later in the document.
    • Answer: True
    • Rationale: The `` element is used to define elements that can be reused within the SVG document.
  3. The xlink:href attribute is used to reference an external resource in SVG.
    • Answer: True
    • Rationale: The xlink:href attribute is used to reference external resources, such as images or other SVG elements.

Additional Multiple Choice Questions

  1. Which attribute is used to define the opacity of an SVG element?
    • a) opacity
    • b) transparency
    • c) alpha
    • d) visibility