.ToastBox { position: absolute; top: -100px; left: 50%; padding: 0 20px; min-width: 200px; height: 64px; line-height: 64px; text-align: center; background-color: #ffd506; border-radius: 48px; transform: translate(-50%); transition: all 400ms; color: #fff; opacity: 0; } .ToastBox.show { top: 100px; opacity: 1; }