Skip to main content

Fundamentals of Front End Development MCQs with Answers

Practice important Fundamentals of Front End Development MCQs with answers and explanations.

Chapter: 42
Q481:
Which property hides an element and removes it from the layout entirely?
A. visibility: hidden;
B. display: none;
C. margin: 0;
D. padding: 0;
Correct Answer: B
Chapter: 42
Q482:
What is the effect of setting `visibility: hidden` on an element?
A. The element will be hidden but still take up space.
B. The element will be visible but hidden.
C. The element will not take up any space.
D. The element will have a 17px margin.
Correct Answer: A
Chapter: 42
Q483:
Which CSS property is used to align elements using absolute positioning?
A. margin-left: auto;
B. margin-right: auto;
C. position: absolute;
D. float: right;
Correct Answer: B
Chapter: 42
Q484:
In CSS, what does setting `float: right` do?
A. It moves the element to the right side of its container.
B. It centers the element horizontally.
C. It hides the element from view.
D. It makes the element take up the full width of its container.
Correct Answer: A
Chapter: 42
Q485:
What is the purpose of the `display` property in CSS?
A. To specify how an element is displayed on the page.
B. To specify if an element should be visible or hidden.
C. To set the margins of an element.
D. To set the width of an element.
Correct Answer: A
Chapter: 42
Q486:
Which of the following is a block element?
A. <span>
B. <a>
C. <p>
D. <li>
Correct Answer: C
Chapter: 42
Q487:
What does the CSS rule `li {display: inline;}` do?
A. It changes <li> elements to be inline elements.
B. It hides <li> elements from view.
C. It makes <li> elements take up full width.
D. It positions <li> elements absolutely.
Correct Answer: A
Chapter: 42
Q488:
What issue might you encounter with IE8 if the `!DOCTYPE` declaration is missing?
A. Extra margin on the right side of the container.
B. Elements are not displayed.
C. Elements are displayed incorrectly.
D. Margins are not applied.
Correct Answer: A
Chapter: 43
Q489:
Which CSS positioning property keeps an element fixed relative to the browser window?
A. static
B. position: fixed;
C. position: relative;
D. position: absolute;
Correct Answer: B
Chapter: 43
Q490:
What happens to an element with `position: fixed` when the browser window is scrolled?
A. It moves along with the scroll.
B. It remains in the same position relative to the browser window.
C. It overlaps other elements.
D. It moves relative to its normal position.
Correct Answer: B
Chapter: 43
Q491:
Which positioning property is used to position an element relative to its normal position?
A. static
B. position: fixed;
C. position: relative;
D. position: absolute;
Correct Answer: C
Chapter: 43
Q492:
What does the `z-index` property control in CSS?
A. The stack order of an element.
B. The position of an element relative to the viewport.
C. The size of the element.
D. The distance from the top of the element.
Correct Answer: A
Chapter: 43
Q493:
Which CSS property is used to move an element to the right side of its container and let other elements wrap around it?
A. position: absolute;
B. float: right;
C. margin-right: auto;
D. text-align: right;
Correct Answer: B
Chapter: 43
Q494:
Which positioning method removes an element from the normal flow of the document?
A. static
B. position: fixed;
C. position: relative;
D. position: absolute;
Correct Answer: D
Chapter: 43
Q495:
What is the default positioning method for HTML elements?
A. static
B. position: fixed;
C. position: relative;
D. position: absolute;
Correct Answer: A
Chapter: 43
Q496:
What is the effect of `float: right` on an image in CSS?
A. The image will float to the right, and text will wrap around it.
B. The image will be centered horizontally.
C. The image will float to the left.
D. The image will be positioned at the top of the container.
Correct Answer: A
Chapter: 43
Q497:
Which CSS property specifies that floating elements should not overlap an element?
A. clear
B. margin
C. padding
D. position;
Correct Answer: A
Chapter: 43
Q498:
Which CSS combinator selects all elements that are descendants of a specified element?
A. descendant selector
B. child selector
C. adjacent sibling selector
D. general sibling selector
Correct Answer: A
Chapter: 43
Q499:
What does the child selector `div > p` select?
A. All <p> elements inside <div> elements.
B. All <p> elements that are immediate children of <div> elements.
C. All <p> elements that follow <div> elements.
D. All <p> elements that are siblings of <div> elements.
Correct Answer: B
Chapter: 43
Q500:
Which combinator selects the elements immediately following a specified element?
A. descendant selector
B. child selector
C. adjacent sibling selector
D. general sibling selector
Correct Answer: C

Test Your Knowledge

Take a timed quiz on Fundamentals of Front End Development

🚀 Start Quiz Now