<div id="description">
  <h2>Приклад 1</h2>
  <p>Наведіть курсор на квадрат, щоб побачити ефект функції invert().</p>
</div>

<div id="result">
  <div class="square"></div>
</div>
#description {
  background-color: #f2f2f2;
  padding: 20px;
  font-family: Arial, sans-serif;
  margin-bottom: 20px;
}

.square {
  width: 200px;
  height: 200px;
  background-color: #ff0000;
  transition: filter 0.5s ease;
}

.square:hover {
  filter: invert(100%);
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.