-
web.groovymark@gmail.com
- December 14, 2024
Question 21
Which CSS property is used to apply a shadow effect to an element’s box?
a) box-shadow
b) text-shadow
c) border-shadow
d) box-outline
Correct Answer: a) box-shadow
Explanation: The box-shadow property adds shadow effects around the border of an element.
Question 22
What is the default position value for HTML elements in CSS?
a) relative
b) absolute
c) static
d) fixed
Correct Answer: c) static
Explanation: The default position for elements in CSS is static, meaning they appear in the normal document flow.
Question 23
Which CSS property can be used to create a smooth change from one style to another?
a) transform
b) transition
c) animation
d) filter
Correct Answer: b) transition
Explanation: The transition property allows for smooth changes when the value of a property changes, such as color or size.
Question 24
What does the display:inline-block CSS property do?
a) Displays the element as a block but with inline formatting
b) Displays the element as fully inline
c) Hides the element
d) Displays the element as a list item
Correct Answer: a) Displays the element as a block but with inline formatting
Explanation: The inline-block value allows an element to behave like a block-level element but remain inline within its parent container.
Question 25
Which CSS property controls the visibility of an element without affecting layout?
a) visibility
b) display
c) opacity
d) z-index
Correct Answer: a) visibility
Explanation: The visibility property hides an element while keeping the space it occupies in the layout.
Question 26
Which unit of measurement is relative to 1% of the viewport width?
a) vh
b) vw
c) em
d) px
Correct Answer: b) vw
Explanation: The vw unit represents 1% of the viewport width, making it responsive to screen size changes.
Question 27
What does the :hover pseudo-class do in CSS?
a) Targets the first child element
b) Targets the element when hovered over
c) Targets the element when it gains focus
d) Targets the element when clicked
Correct Answer: b) Targets the element when hovered over
Explanation: The :hover pseudo-class applies styles to an element when the user hovers over it with a pointer device.
Question 28
Which CSS property controls how elements float?
a) float
b) clear
c) position
d) display
Correct Answer: a) float
Explanation: The float property allows elements to be positioned left or right of their container, causing surrounding text to wrap around them.
Question 29
Which CSS property allows you to apply multiple background images to an element?
a) background
b) background-image
c) background-layer
d) multi-background
Correct Answer: b) background-image
Explanation: The background-image property allows the use of multiple background images by separating the values with commas.
Question 30
Which property is used to adjust the space between letters in CSS?
a) letter-spacing
b) word-spacing
c) text-indent
d) font-spacing
Correct Answer: a) letter-spacing
Explanation: The letter-spacing property is used to control the space between individual letters in a text.
Question 31
What is the default value of the flex-direction property?
a) row
b) column
c) reverse
d) inherit
Correct Answer: a) row
Explanation: By default, the flex-direction property lays out items in a row, from left to right.
Question 32
Which CSS property is used to round the corners of an element’s border?
a) border
b) border-radius
c) outline-radius
d) box-shadow
Correct Answer: b) border-radius
Explanation: The border-radius property is used to round the corners of an element’s border.
Question 33
Which HTML5 element is used to mark text that is important or highlighted?
a) <mark>
b) <strong>
c) <b>
d) <em>
Correct Answer: a) <mark>
Explanation: The <mark> element highlights important text by applying a yellow background color by default.
Question 34
Which tag is used to create an inline container for applying styles in CSS?
a) <div>
b) <span>
c) <section>
d) <container>
Correct Answer: b) <span>
Explanation: The <span> tag is used to create an inline container for applying CSS styles or grouping inline elements.
Question 35
What is the purpose of the <noscript> tag in HTML?
a) To provide content for browsers that do not support JavaScript
b) To comment out JavaScript code
c) To define a block of JavaScript code
d) To add metadata for JavaScript
Correct Answer: a) To provide content for browsers that do not support JavaScript
Explanation: The <noscript> tag displays alternate content if the browser does not support or has JavaScript disabled.
Question 36
Which attribute is used to specify a default value for an input element?
a) name
b) id
c) value
d) placeholder
Correct Answer: c) value
Explanation: The value attribute specifies the default value for an <input> element.
Question 37
What is the purpose of the autoplay attribute in the <audio> tag?
a) To display audio controls
b) To automatically play the audio file
c) To specify the audio source
d) To preload the audio file
Correct Answer: b) To automatically play the audio file
Explanation: The autoplay attribute ensures the audio file starts playing automatically once the page is loaded.
Question 38
Which CSS property is used to add space inside the border of an element?
a) margin
b) padding
c) border-spacing
d) spacing
Correct Answer: b) padding
Explanation: The padding property adds space inside the element’s border, affecting the layout without moving the element.
Question 39
Which CSS pseudo-class is used to apply styles to a link that has been visited?
a) :hover
b) :active
c) :visited
d) :focus
Correct Answer: c) :visited
Explanation: The :visited pseudo-class applies styles to links that have been clicked by the user.
Question 40
Which attribute is used to allow multiple file uploads in an HTML form?
a) multiple
b) filetype
c) multiselect
d) files
Correct Answer: a) multiple
Explanation: The multiple attribute allows users to select and upload more than one file in an input form.