Cyber Olympiad Class 10 - Sample question paper 06
Posted by Olympiad Tester on
Q1. What does the HTML attribute "defer" do when included in a script tag?
a) Delays the execution of the script until after the document is parsed.
b) Forces the script to execute immediately.
c) Specifies the default font for the script content.
d) Defines a deferred function to be executed later.
Answer: a) Delays the execution of the script until after the document is parsed.
Explanation: The "defer" attribute in a script tag delays script execution until after the document is parsed.
Q2. Which CSS property is used to set the transparency of an element?
a) opacity.
b) visibility.
c) transparent.
d) background-opacity.
Answer: a) opacity.
Explanation: The "opacity" property controls the transparency of an element, with values ranging from 0 (fully transparent) to 1 (fully opaque).
Q3. In CSS, what does the "display: flex;" property do?
a) Enables the display of an element as a block-level container.
b) Activates flexible box layout for an element's children.
c) Hides an element from the layout.
d) Sets the element's display to inline-block.
Answer: b) Activates flexible box layout for an element's children.
Explanation: "display: flex;" enables the flexible box layout, allowing easier alignment and distribution of space among a group of items.
Q4. What is the purpose of the HTML "role" attribute?
a) Specifies the language of the document.
b) Defines the keyboard shortcut for an element.
c) Indicates the intended role of an element for accessibility.
d) Sets the tab order of elements in the document.
Answer: c) Indicates the intended role of an element for accessibility.
Explanation: The "role" attribute in HTML is used to define the intended role of an element for accessibility purposes.
Q5. What is the purpose of the CSS "flex-grow" property?
a) Sets the initial size of a flex container.
b) Determines the ability of a flex item to grow relative to other items.
c) Controls the spacing between flex items.
d) Defines the order of a flex item within a container.
Answer: b) Determines the ability of a flex item to grow relative to other items.
Explanation: "flex-grow" specifies the ability of a flex item to grow proportionally to the other flex items in the container.
Q6. What does the CSS pseudo-class ":nth-child(odd)" select?
a) Selects the first child element.
b) Selects all odd-numbered child elements.
c) Selects the last child element.
d) Selects the even-numbered child elements.
Answer: b) Selects all odd-numbered child elements.
Explanation: ":nth-child(odd)" selects all child elements with odd index positions.
Q7. What is the purpose of the HTML "contenteditable" attribute?
a) Makes the content visually editable by the user.
b) Specifies the character encoding of the document.
c) Defines the content type for a form.
d) Sets the alignment of an element's content.
Answer: a) Makes the content visually editable by the user.
Explanation: The "contenteditable" attribute allows users to edit the content directly within the HTML element.
Q8. What does the CSS property "mix-blend-mode" control?
a) Adjusts the brightness of an element.
b) Specifies the blending mode for layered elements.
c) Sets the order of overlapping elements.
d) Defines the spacing between letters in a text.
Answer: b) Specifies the blending mode for layered elements.
Explanation: "mix-blend-mode" controls the blending mode for layered elements, affecting how they interact with each other.
Q9. In CSS, what is the purpose of the "object-fit" property?
a) Adjusts the transparency of an element.
b) Specifies how an element's content should be sized to fit its container.
c) Aligns the content of a flex container.
d) Sets the font style for text within an element.
Answer: b) Specifies how an element's content should be sized to fit its container.
Explanation: "object-fit" controls how the content of an element should be sized to fit its container.
Q10. What is the purpose of the HTML "hidden" attribute?
a) Visually hides an element from the page.
b) Defines a hidden input field in a form.
c) Specifies the color of the text within an element.
d) Sets a background image for an element.
Answer: a) Visually hides an element from the page.
Explanation: The "hidden" attribute is used to visually hide an element from the page, making it not visible to users.
Q11. What does the CSS property "grid-template-areas" define?
a) Defines the columns and rows for a grid layout.
b) Specifies the areas within a grid container where items can be placed.
c) Sets the alignment of items within a flex container.
d) Controls the visibility of grid lines.
Answer: b) Specifies the areas within a grid container where items can be placed.
Explanation: "grid-template-areas" defines named grid areas, allowing items to be placed within specific regions of a grid container.
Q12. What is the purpose of the HTML "aria-live" attribute?
a) Defines a live audio stream for the document.
b) Specifies the duration of a multimedia file.
c) Indicates that updates to the content should be communicated to the user.
d) Sets the playback speed of a video element.
Answer: c) Indicates that updates to the content should be communicated to the user.
Explanation: The "aria-live" attribute is used to indicate that updates to the content should be communicated to the user, particularly in accessibility contexts.
Q13. What does the CSS property "word-break: break-all;" do?
a) Forces a line break within a word to avoid overflow.
b) Breaks words at the end of a line to fit within the container.
c) Breaks words at arbitrary points to prevent overflow.
d) Breaks words only at specified breakpoints.
Answer: c) Breaks words at arbitrary points to prevent overflow.
Explanation: "word-break: break-all;" breaks words at arbitrary points to prevent overflow and maintain responsiveness.
Q14. What does the HTML "picture" element provide in web development?
a) Embeds an image in a document.
b) Creates a slideshow of images.
c) Allows multiple sources for an image, based on different conditions.
d) Defines a container for videos.
Answer: c) Allows multiple sources for an image, based on different conditions.
Explanation: The "picture" element allows developers to provide multiple sources for an image, selecting the appropriate source based on conditions like screen size or resolution.
Q15. What is the purpose of the CSS property "will-change"?
a) Specifies the font weight of text within an element.
b) Indicates that an element is expected to change in the future.
c) Controls the visibility of an element.
d) Sets the animation duration for an element.
Answer: b) Indicates that an element is expected to change in the future.
Explanation: "will-change" is used to indicate that an element is expected to change in the future, allowing browsers to optimize rendering performance.
Q16. What does the CSS property "pointer-events: none;" do?
a) Changes the cursor style to a pointer.
b) Disables the element from responding to user input events.
c) Specifies the spacing between lines of text within an element.
d) Sets the order of stacked elements in the z-axis.
Answer: b) Disables the element from responding to user input events.
Explanation: "pointer-events: none;" disables the element from responding to user input events, allowing interaction with elements behind it.
Q17. What does the HTML "scoped" attribute in a style tag indicate?
a) Applies styles globally to all elements in the document.
b) Restricts the application of styles to the parent element.
c) Applies styles only to the current document's head section.
d) Sets the scope for variable values within a style sheet.
Answer: c) Applies styles only to the current document's head section.
Explanation: The "scoped" attribute in a style tag applies styles only to the current document's head section, limiting the scope of the styles.
Q18. In CSS, what does the "ch" unit represent?
a) Represents the width of the "0" (zero) character in the font.
b) Stands for "character height" and defines the height of a line of text.
c) Specifies the width of a container based on the viewport width.
d) Represents the height of the viewport in pixels.
Answer: a) Represents the width of the "0" (zero) character in the font.
Explanation: The "ch" unit represents the width of the "0" (zero) character in the font.
Q19. What is the purpose of the CSS "counter-increment" property?
a) Sets the starting value for a counter.
b) Increments the value of a counter on specified elements.
c) Controls the appearance of list items.
d) Specifies the rotation angle of an element.
Answer: b) Increments the value of a counter on specified elements.
Explanation: "counter-increment" is used to increment the value of a counter on specified elements, allowing dynamic numbering or labeling.
Q20. How does the CSS property "text-overflow: ellipsis;" affect text overflow in an element?
a) Displays a scrollbar for overflowed text.
b) Hides overflowed text.
c) Adds an ellipsis (...) to indicate truncated text.
d) Breaks words at the end of a line.
Answer: c) Adds an ellipsis (...) to indicate truncated text.
Explanation: "text-overflow: ellipsis;" adds an ellipsis (...) to indicate that text has been truncated in an overflow situation.
Q21. What is the purpose of the CSS "currentColor" keyword?
a) Represents the color of the element itself.
b) Refers to the background color of the document.
c) Specifies the current time in an animation.
d) Sets the color to a transparent value.
Answer: a) Represents the color of the element itself.
Explanation: The "currentColor" keyword sets the color of an element to its computed color value, which is often inherited from its parent.
Q22. What does the CSS property "orphans" control?
a) Adjusts the opacity of an element.
b) Specifies the minimum number of lines in a block container that must be left at the bottom of a page.
c) Sets the spacing between words in a text element.
d) Defines the number of lines in a block container that may be left at the top of a page.
Answer: b) Specifies the minimum number of lines in a block container that must be left at the bottom of a page.
Explanation: "orphans" in CSS controls the minimum number of lines in a block container that must be left at the bottom of a page.
Q23. What is the purpose of the HTML "download" attribute in an anchor (a) tag?
a) Sets the download speed for linked resources.
b) Downloads a file when the link is clicked, instead of navigating to it.
c) Specifies the file size of the linked resource.
d) Defines the target frame for the linked resource.
Answer: b) Downloads a file when the link is clicked, instead of navigating to it.
Explanation: The "download" attribute in an anchor tag prompts the user to download the linked resource rather than navigating to it.
Q24. What does the CSS property "clip-path" do?
a) Specifies the path of an SVG image.
b) Defines the shape of the visible portion of an element.
c) Clips an element to a specific size.
d) Adjusts the visibility of overlapping elements.
Answer: b) Defines the shape of the visible portion of an element.
Explanation: "clip-path" in CSS defines the shape of the visible portion of an element, allowing for creative masking and clipping effects.
Q25. What is the purpose of the HTML "sandbox" attribute in an iframe?
a) Limits the content of the iframe to a secure sandbox environment.
b) Sets the background color of the iframe.
c) Defines the source URL for the iframe.
d) Adjusts the height and width of the iframe.
Answer: a) Limits the content of the iframe to a secure sandbox environment.
Explanation: The "sandbox" attribute in an iframe limits its content to a secure sandbox environment, restricting potentially harmful actions.
Q26. In CSS, what does the "backdrop-filter" property control?
a) Adjusts the brightness of the background image.
b) Applies a filter effect to the background of an element.
c) Modifies the filter settings of child elements.
d) Sets the transparency of the backdrop behind an element.
Answer: b) Applies a filter effect to the background of an element.
Explanation: "backdrop-filter" in CSS applies a filter effect to the background of an element, affecting the area behind the element.
Q27. What is the purpose of the CSS "attr()" function?
a) Sets the background color of an element based on user interaction.
b) Retrieves and applies the value of a specified attribute as a CSS property.
c) Defines the rotation angle of a transformed element.
d) Adjusts the spacing between lines of text within an element.
Answer: b) Retrieves and applies the value of a specified attribute as a CSS property.
Explanation: The "attr()" function in CSS retrieves and applies the value of a specified attribute as a CSS property.
Q28. What does the HTML "translate" attribute in a script tag indicate?
a) Specifies the language of the script.
b) Sets the translation language for the document.
c) Defines the type of translation to be applied to the script content.
d) Indicates whether the script should be translated or not.
Answer: d) Indicates whether the script should be translated or not.
Explanation: The "translate" attribute in a script tag indicates whether the script content should be translated or not.
Q29. What is the purpose of the CSS "all" shorthand property?
a) Resets all styles to default values.
b) Applies a style to all elements in the document.
c) Specifies a single style rule for multiple properties.
d) Resets all styles for a specific element to default values.
Answer: c) Specifies a single style rule for multiple properties.
Explanation: The "all" shorthand property in CSS specifies a single style rule for multiple properties, affecting the entire document.
Q30. In CSS, what does the "object-position" property control?
a) Specifies the position of a background image within its container.
b) Sets the position of an element using absolute coordinates.
c) Defines the alignment of inline elements.
d) Controls the stacking order of positioned elements.
Answer: a) Specifies the position of a background image within its container.
Explanation: "object-position" in CSS controls the position of a background image within its container.
Q31. What is the purpose of the HTML "async" attribute in a script tag?
a) Specifies that the script should be executed asynchronously.
b) Defines the scripting language of the document.
c) Sets the source URL for the script.
d) Delays the execution of the script until after the document is parsed.
Answer: a) Specifies that the script should be executed asynchronously.
Explanation: The "async" attribute in a script tag specifies that the script should be executed asynchronously, allowing it to run independently of the document parsing process.
Q32. In CSS, what does the "ch" unit represent?
a) Represents the width of the "0" (zero) character in the font.
b) Stands for "character height" and defines the height of a line of text.
c) Specifies the width of a container based on the viewport width.
d) Represents the height of the viewport in pixels.
Answer: a) Represents the width of the "0" (zero) character in the font.
Explanation: The "ch" unit represents the width of the "0" (zero) character in the font.
Q33. What is the purpose of the HTML "loading" attribute in an iframe?
a) Defines the loading time of the iframe content.
b) Specifies the loading priority of the iframe.
c) Indicates whether the iframe content should be preloaded.
d) Sets the loading strategy for the iframe content.
Answer: c) Indicates whether the iframe content should be preloaded.
Explanation: The "loading" attribute in an iframe indicates whether the iframe content should be preloaded, optimizing performance based on user interactions.
Q34. What does the CSS property "aspect-ratio" control?
a) Adjusts the aspect ratio of a background image.
b) Sets the aspect ratio for an inline element.
c) Defines the aspect ratio of a flex container.
d) Specifies the aspect ratio of an element's content box.
Answer: d) Specifies the aspect ratio of an element's content box.
Explanation: "aspect-ratio" in CSS specifies the aspect ratio of an element's content box, helping maintain proportional sizing.
Q35. What is the purpose of the CSS "conic-gradient" function?
a) Creates a linear gradient from top to bottom.
b) Generates a gradient with multiple color stops arranged in a circle.
c) Applies a gradient background to an element.
d) Sets the gradient direction based on the angle specified.
Answer: b) Generates a gradient with multiple color stops arranged in a circle.
Explanation: The "conic-gradient" function in CSS generates a gradient with multiple color stops arranged in a circular pattern.