CSS Properties: How to set visibility property of an element
Solution:
HTML Code:
Explanation:
- This HTML document demonstrates the use of the visibility property to control the visibility of images.
- CSS rules are defined for images with classes visible and hidden to set their visibility accordingly.
- visibility: visible; makes the image visible.
- visibility: hidden; hides the image while still taking up space in the layout.
- Images with different visibility settings are displayed within headings to illustrate the effect.
Live Demo:
See the solution in the browser
Supported browser
![]() |
![]() |
![]() |
![]() |
![]() |
Yes | Yes | Yes | Yes | Yes |
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics