MCQs
MCQs
CSS Questions
11.Which property is used to change the font of text?
a) text-style
➡ b) font-family
c) text-font
d) font-weight
12.How can you make a background image cover the entire container?
➡ a) background-size: cover;
b) background-size: full;
c) background-fit: cover;
d) background: stretch;
13.Which CSS property controls the space between elements?
➡ a) margin
b) padding
c) border-spacing
d) spacing
14.Which of the following is a valid way to apply multiple background
images in CSS?
a) background-image: url(image1.jpg) + url(image2.jpg);
b) background-image: [image1.jpg, image2.jpg];
➡ c) background-image: url(image1.jpg), url(image2.jpg);
d) background-image: (image1.jpg, image2.jpg);
15.Which CSS property makes an element disappear but still occupy
space?
➡ a) visibility: hidden;
b) display: none;
c) opacity: 0;
d) filter: blur(100%);
16.What is the default position property of an HTML element?
a) absolute
➡ b) static
c) relative
d) fixed
17.Which pseudo-class applies styles when a user hovers over an
element?
➡ a) :hover
b) :focus
c) :active
d) :visited
18.Which value of display property allows elements to be arranged in a
grid layout?
a) inline-block
b) flex
➡ c) grid
d) block
19.Which property is used to change the order of items in a flex container?
a) order-index
➡ b) order
c) position
d) flex-direction
20.What does z-index control?
a) Opacity of elements
b) The rotation of elements
➡ c) The stacking order of elements
d) The spacing between elements
JavaScript Questions
21.Which of the following is a valid JavaScript variable name?
a) 2variable
➡ b) _variableName
c) var-name
d) function
22.Which method is used to remove an element from an array by index?
a) pop()
➡ b) splice()
c) shift()
d) slice()
23.What does typeof NaN return in JavaScript?
a) "null"
➡ b) "number"
c) "undefined"
d) "NaN"
24.Which JavaScript method converts a JSON string into a JavaScript
object?
➡ a) JSON.parse()
b) JSON.stringify()
c) toObject()
d) parseJSON()
25.What will console.log(2 == "2") return?
➡ a) true
b) false
c) undefined
d) Error
26.Which function is used to delay execution of a JavaScript function?
➡ a) setTimeout()
b) setInterval()
c) delay()
d) wait()
27.Which symbol is used for optional chaining in JavaScript?
➡ a) ?.
b) ??
c) =>
d) ::
28.What does the map() function do in JavaScript?
a) Iterates over an array and modifies its elements
➡ b) Creates a new array with modified elements
c) Filters elements in an array
d) Finds an element in an array
29.Which JavaScript keyword is used to handle asynchronous operations?
a) sync
➡ b) async
c) await
d) callback
30.Which method is used to find the index of an element in an array?
a) search()
b) getIndex()
➡ c) indexOf()
d) findIndex()