Jump into concepts and practice - no test required
or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Recall & Review
beginner
What does the CSS visibility property control?
The visibility property controls whether an element is visible or hidden on the page, but it still takes up space even when hidden.
Click to reveal answer
beginner
What is the difference between visibility: hidden; and display: none;?
visibility: hidden; hides the element but keeps its space on the page. display: none; removes the element completely, so it takes no space.
Click to reveal answer
intermediate
What are the possible values of the visibility property?
Common values are: - visible: element is shown - hidden: element is hidden but space remains - collapse: for table rows/columns, hides and removes space - inherit: takes value from parent
Click to reveal answer
intermediate
How does visibility: collapse; behave in tables?
In tables, visibility: collapse; hides the row or column and removes its space, similar to display: none;, but only for table elements.
Click to reveal answer
beginner
Why might you use visibility: hidden; instead of display: none;?
Use visibility: hidden; when you want to hide an element but keep its space to avoid layout shifts or keep the page structure stable.
Click to reveal answer
What happens when you set visibility: hidden; on an element?
AThe element becomes transparent but clickable
BThe element is removed and space is freed
CThe element is hidden but space is kept
DThe element is visible but blurred
✗ Incorrect
visibility: hidden; hides the element but keeps its space on the page.
Which CSS property removes an element and frees its space completely?
Avisibility: hidden;
Bopacity: 0;
Cvisibility: collapse;
Ddisplay: none;
✗ Incorrect
display: none; removes the element from the layout, freeing its space.
What is the default value of the visibility property?
Ahidden
Bvisible
Ccollapse
Dnone
✗ Incorrect
By default, elements have visibility: visible;, meaning they are shown.
For which HTML elements does visibility: collapse; have a special effect?
ATable rows and columns
BParagraphs
CImages
DButtons
✗ Incorrect
visibility: collapse; hides table rows or columns and removes their space.
If you want to hide an element but keep the page layout unchanged, which property should you use?
Avisibility: hidden;
Bopacity: 0;
Cdisplay: none;
Dposition: absolute;
✗ Incorrect
visibility: hidden; hides the element but keeps its space, preserving layout.
Explain how the CSS visibility property affects an element's display and layout on a webpage.
Think about how hiding differs from removing an element.
You got /4 concepts.
Describe a situation where using visibility: hidden; is better than display: none;.
Consider user experience when content disappears.
You got /3 concepts.
Practice
(1/5)
1. What does the CSS property visibility: hidden; do to an element on a webpage?
easy
A. It makes the element transparent but still clickable.
B. It hides the element but keeps its space reserved on the page.
C. It removes the element completely from the page layout.
D. It changes the element's color to match the background.
Solution
Step 1: Understand the visibility property
The visibility property controls whether an element is visible or hidden but does not affect layout space.
Step 2: Analyze the effect of hidden
When set to hidden, the element is not shown but still occupies space on the page.
Final Answer:
It hides the element but keeps its space reserved on the page. -> Option B
Quick Check:
visibility: hidden hides but keeps space [OK]
Hint: Hidden keeps space, display none removes it [OK]
Common Mistakes:
Confusing visibility: hidden with display: none
Thinking hidden elements are clickable
Assuming hidden elements disappear completely
2. Which of the following is the correct CSS syntax to hide an element but keep its space using the visibility property?
easy
A. visibility: hidden;
B. visibility = hidden;
C. visible: hidden;
D. hide: visibility;
Solution
Step 1: Recall correct CSS property syntax
CSS properties use a colon : between property and value, ending with a semicolon.
Step 2: Match syntax to visibility property
The correct syntax is visibility: hidden; to hide but keep space.
Final Answer:
visibility: hidden; -> Option A
Quick Check:
Property: value; is correct CSS syntax [OK]
Hint: Use colon, not equals, for CSS properties [OK]