Simple Quiz dated 23/06/2023

Hello everyone!

Here I am having some simple interesting mcq questions. Kindly everyone answer for it!

1: Which CSS property is used to change the text color of an element?
A) background-color B) text-decoration C) color D) font-family

2: Which CSS property is used to add a background image to an element?
A) background-color B) background-image C) background-position D) background-repeat

3: Which CSS property is used to create rounded corners for an element?
A) border-color B) border-style C) border-radius D) border-width

4: Which CSS property is used to control the positioning of an element in relation to its closest positioned ancestor?
A) position B) top C) left D) z-index

5: Which CSS property is used to control the transparency of an element?
A) opacity B) visibility C) display D) filter

Thanks & Regards
Dharshini M

2 Likes

1: C) color -The CSS property used to change the text color of an element is “color”. It allows you to specify the color of the text content within the element. For example, you can use the “color” property to set the text color to red, blue, or any other valid color value.

2: B) background-image - The CSS property used to add a background image to an element is “background-image”. This property allows you to specify an image file to be used as the background of the element. You can provide the URL of the image file as the value of the “background-image” property, and the image will be displayed as the background of the element.

3: C) border-radius- The CSS property used to create rounded corners for an element is “border-radius”. This property allows you to specify the radius of the corners of the element’s border. By setting the value of “border-radius” to a specific length or percentage, you can create rounded corners for the element. This property is commonly used to add a softer and more visually appealng appearance to elements such as buttons or containers.

4: A) position- The CSS property used to control the positioning of an element in relation to its closest positioned ancestor is “position”. This property allows you to specify how an element should be positioned within its containing element. By using values like “relative”, “absolute”, or “fixed” for the “position” property, you can control the element’s placement on the page. The “top”, “left”, “right”, and “bottom” properties can be used in conjunction with “position” to further adjust the element’s position.

5: A) opacity-The CSS property used to control the transparency of an element is “opacity”. This property allows you to adjust the level of transparency or opacity of an element. A value of 1 indicates full opacity, while a value of 0 indicates complete transparency. Intermediate values between 0 and 1 can be used to achieve varying degrees of transparency. The “opacity” property is commonly used to create visually appealing effects, such as fading in or out elements.

3 Likes

1: color
2: background-image
3: border-radius
4: position
5: opacity

2 Likes

@vishalke035 @akshithasams

Thank you for your valuable responses!

Have a Happy Learning! :grinning:

3 Likes