Код IT
← Каталог

Шаблоны простых элементов веб-страниц — CSS

Фрагмент из «Шаблоны простых элементов веб-страниц»: CSS.

CSS main.css
#notificationContainer {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  max-width: 400px;
}

.notification {
  padding: 1rem 1.5rem;
  margin-bottom: 0.75rem;
  border-radius: 4px;
  color: white;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  animation: slideInRight 0.3s ease-out;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.notification.success { background-color: #28a745; }
.notification.error   { background-color: #dc3545; }
.notification.warning { background-color: #ffc107; color: #212529; }

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.close-notification {
  background: none;
  border: none;
  color: inherit;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 0.5rem;
}
#notificationContainer {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  max-width: 400px;
}

.notification {
  padding: 1rem 1.5rem;
  margin-bottom: 0.75rem;
  border-radius: 4px;
  color: white;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  animation: slideInRight 0.3s ease-out;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.notification.success { background-color: #28a745; }
.notification.error   { background-color: #dc3545; }
.notification.warning { background-color: #ffc107; color: #212529; }

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.close-notification {
  background: none;
  border: none;
  color: inherit;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 0.5rem;
}