身体媒体查询不起作用

时间:2017-08-18 22:27:25

标签: html css media-queries

我有一个导航栏,其中包含允许内容显示在导航栏下方的填充。对于手机我想减少填充但媒体查询似乎不起作用。有什么想法吗?

示例:



body{
  padding-top: 70px; 
}
p.t{
  color: white;
  background-color: black;
  top: 0px;
  position: absolute;
}
@media only screen and (max-width: 767px) {
    .body {
        padding-top: 0px;
    }
}

<body>
<p class="t">
This is my pretend navbar woo.
</p>
<p>
hello
</p>
</body>
&#13;
&#13;
&#13;

1 个答案:

答案 0 :(得分:2)

您正在-000000001 If number was negative 000000001 If number was positive 而不是 var loadSortedPages = function(page) { var skip = page*50; var options = { "filter": {}, "sort": {"points": 1}, "pageSize": "50", "skip": skip.toString() } buildfire.publicData.search(options, 'users', function(err, records) { console.log("RECORDS SORTED ASCENDING BY POINTS FOR PAGE " + page, records); }); } loadSortedPages(0); loadSortedPages(1); loadSortedPages(2); 。通过使用.body,CSS正在搜索具有class="body"的元素,而不是元素<body>。简单修复:

body