我不确定为什么我的媒体查询在大于指定尺寸的情况下仍能生效。例如,一个类名为portrait的图片在我的笔记本电脑上显示为250像素,而不是预期的400像素。 我的媒体查询结构如下,并位于CSS末尾。 @media screen and (max-width: 767px) { .portrait { height: 250px; } } 完整代码:Codeply
在媒体查询中,你的.about-text样式中有多余的闭合括号。 .about-text { font-size: 15px; padding: 1.4em; /* Removes margin added in main CSS */ margin-bottom: 0; } <-- } 只需将其删除,它就会按预期工作。