div {
display: inline-block;
padding: 30px;
color: sienna;
background: ivory;
border: 1px solid goldenrod;
overflow: auto;
resize: horizontal;
}
@element '.div1' and (min-width: 300px) {
.div1 {
background: gold;
}
}
@element '.div1' and (min-width: 600px) {
.div1 {
background: red;
}
}
<script src='https://cdnjs.cloudflare.com/ajax/libs/eqcss/1.2.1/EQCSS.min.js'></script>
<div class="div1">Click and drag until larger than 300px ➷</div>
It is not working in Dot Net. It is working only HTML Page. A question is that Can media queries resize based on a div element instead of the screen?