<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Tinyone</title>
<link rel="stylesheet" href="css/bootstrap.min.css">
</head>
<body>
<div class="container">
<div class="alert alert-primary col-xl-alert-danger" role="alert">
<strong>Well done!</strong> You successfully read this important alert message.
</div>
</div>
</body>
@media (max-width: 575px) {
.alert--test {
background-color: var(--primary);
}
}
@media (min-width: 576px) and (max-width: 991px) {
.alert--test {
background-color: var(--success);
}
}
@media (min-width: 992px) and (max-width: 1999px) {
.alert--test {
background-color: var(--warning);
}
}
@media (min-width: 1200px) {
.alert--test {
background-color: var(--danger);
}
}
alert-primary col-xl-alert-danger
и добавить уникальный класс, в моем случае это, например, alert--test
. @media (max-width: 576px) {
.col-xl-alert-danger {
background: blue;
}
}
@media (min-width: 1200px) {
.col-xl-alert-danger {
background: red;
}
}
@media (min-width: 992px) and (min-width: 1200px) {
.col-xl-alert-danger {
background: yellow;
}
}
@media (min-width: 576px) and (min-width: 992px) {
.col-xl-alert-danger {
background: green;
}
}