如何為視窗模式設定 CSS 規則?
@media all and (display-mode: fullscreen) {
.testfullscreen {
display: none; /*Works*/
}
}
@media all and not (display-mode: fullscreen) {
.testwindowed {
display: none; /*Not working*/
}
}
密碼筆
uj5u.com熱心網友回復:
你非常接近這一點,你只需要移動not到乞討。
根據 MDN 的檔案:
反轉查詢的含義
not 關鍵字反轉了整個媒體查詢的含義。它只會否定它所應用的特定媒體查詢。(因此,它不適用于以逗號分隔的媒體查詢串列中的每個媒體查詢。) not 關鍵字不能用于否定單個特征查詢,只能用于否定整個媒體查詢。在以下查詢中最后評估 not:
@media not all and (display-mode: fullscreen) {
.testwindowed {
display: none; /*Is working*/
}
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/411130.html
標籤:
