您好,我在使用媒體查詢時遇到問題。我不知道問題是什么,但看著它似乎不起作用的顏色。
我是 css 的新手,但我試圖通過在我的 html 檔案中添加下面寫的內容來修復它(在查看其他帖子后),但它似乎仍然不起作用。
<meta name="viewport" content="width=device-width, initial-scale=1.0">
這是我在我的 css 檔案中嘗試過的代碼:
.newestpost {
line-height: 20px;
height: 400px;
display: ;
width: 600px;
float: left;
margin: 30px 50px;
@media screen and (min-width: 1312px) and (max-width: 3000px)
{
width: 100%;
float: left;
margin: ;
}
}
uj5u.com熱心網友回復:
一個@media查詢應該是一個頂級陳述句,包含CSS規則。您不能將其嵌套在 CSS 規則中。
把它改成這個,看看它是否有效:
.newestpost {
line-height: 20px;
height: 400px;
display: ;
width: 600px;
float: left;
margin: 30px 50px;
}
@media screen and (min-width: 1312px) and (max-width: 3000px)
{
.newestpost {
width: 100%;
float: left;
margin: ;
}
}
uj5u.com熱心網友回復:
您應該在媒體中提及您的 css 類。而且你不能在課堂上使用@media...
.newestpost {
line-height: 20px;
height: 400px;
display: ;
width: 600px;
float: left;
margin: 30px 50px;
}
@media screen and (min-width: 1312px) and (max-width: 3000px) {
.newestpost {
width: 100%;
float: left;
margin: ;
}
}
uj5u.com熱心網友回復:
首先需要在標簽中指定類,這里需要應用樣式
<meta name="viewport" content="width=device-width, initial-scale=1.0">
.newestpost {
line-height: 20px;
height: 400px;
display: ;
width: 600px;
float: left;
margin: 30px 50px;
}
@media screen and (min-width: 1312px) and (max-width: 3000px)
{
.newestpost {
width: 100%;
float: left;
margin: ;
}
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/377805.html
上一篇:中心ngx-分頁
