<div class="block">
  <span>Тицяй</span>
  <span>на</span>
  <span>елементи,</span>
  <span>щоб</span>
  <span>змінити</span>
  <span>значення</span>
  <span>застосовані</span>
  <span>для</span>
  <span>властивості</span>
  <span>visibility...</span>
</div>
.block {
  background-color: #eee;
  padding: 16px;
  line-height: 1.4;
  font-family: monospace;
  font-size: 20px;
}

.block span {
  display: inline-block;
  padding: 2px 8px;
  background-color: orange;
  margin-bottom: 8px;
  border-radius: 8px;
  color: #252525;
  cursor: pointer;
  transition: all 0.1s linear;
  visibility: visible;
}

.block span:hover {
  background-color: gray;
  color: #fff;
}
window.onclick = function(e) {
  e.target.style.visibility = 'hidden';
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.