0
我有一個生成一個否定媒體查詢如下SASS代碼(基於Exact NOT(Inverse) of CSS Media Query):倒相結合媒體查詢
@media not screen and (max-width: 420px) {
.phone {
display: none;
}
}
@media not screen and (min-width: 421px) and (max-width: 992px) {
.tablet {
display: none;
}
}
爲什麼不這項工作聯合班最後一個div?
<div class="phone">visible on: phone</div>
<div class="tablet">visible on: tablet</div>
<div class="phone tablet">visible on: phone and tablet</div>
我顛倒邏輯的原因是因爲,如果我將圍繞做它的其他方式(顯示隱藏的代替)。我不知道每個元素是什麼顯示類型(塊,內聯等)和我can't set it back to it's previous value。