这个问题可能是由于Apple Mail的某些限制造成的。在iPhone和iPad上运行邮件应用程序时,媒体查询也可能无法正常工作。
以下是一些可能有用的解决方案:
尝试使用内联媒体查询而不是外部样式表。例如:
使用CSS代码中适当的选择器和规则。例如:
@media only screen and (max-width: 480px) { /* your CSS styles here */ }
确保在查询中使用正确的CSS属性。例如:
@media screen and (max-width: 480px) { body { background-color: red; } }
尝试使用!important标记强制应用CSS规则。例如:
@media screen and (max-width: 480px) { body { background-color: red !important; } }
确保查询包含viewport meta标签。例如:
这些解决方案中的任何一个都可能解决您在Apple Mail中遇到的媒体查询问题。