0
0
CSSmarkup~5 mins

Visibility property in CSS - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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:<br>- visible: element is shown<br>- hidden: element is hidden but space remains<br>- collapse: for table rows/columns, hides and removes space<br>- 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
Which CSS property removes an element and frees its space completely?
Avisibility: hidden;
Bopacity: 0;
Cvisibility: collapse;
Ddisplay: none;
What is the default value of the visibility property?
Ahidden
Bvisible
Ccollapse
Dnone
For which HTML elements does visibility: collapse; have a special effect?
ATable rows and columns
BParagraphs
CImages
DButtons
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;
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.