Floriane Floriane - 1 year ago 49
HTML Question

How to flash a div only

Can I flash a div using only CSS? I would like this div to flash two colors.

.chat-window .msg-container-base .notification-message-unread{
float: right;
font-size: 10px;
color: #666;
background: white;
padding-left: 10px;
}

Answer Source

Here you go:

.notification-message-unread {
  float: right;
  font-size: 10px;
  color: #666;
  background: white;
  padding-left: 10px;
  display: block;
  position: relative;
  width: 200px;
  height: 200px;
  background-color: red;
  animation: blinker 1s linear infinite;
}

@keyframes blinker {
  50% {
    background-color: blue;
  }
}
<div class="notification-message-unread"></div>

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download