When using container queries. I can't style the element that the container query is set on in the container query itself. Like below.
.container {
width: 250px;
height: 250px;
background-color: hotpink;
container-type: inline-size;
}
@container (max-width: 768px) {
/* This selector doesn't work here */
.container {
background-color: red;
}
}
<div class="container"></div>
Does anyone know why this can't be done?