css - 媒体查询不起作用的通讯信函模板
问题描述
我已经使用媒体查询设置了正文背景颜色,但媒体查询无法使用我的时事通讯模板设计。你能解决这个问题吗?
示例 html:
@media only screen and (max-width: 480px) {
.body1{background: red!important;}
}
<table cellpadding="0" cellspacing="0" width="100%" class="body1" style="border:none !important;background: #e4e3e3;">
<tr>
<td style="border:none !important;padding-left: 25px; padding-right: 25px; padding-bottom: 0px;">
<h1>Welcome Zeeapp</h1>
</td>
</tr>
</table>
解决方案
使用下面的 css 只需删除表格的内联 css 并添加以下代码
<style type="text/css">
@media only screen and (max-width:600px) {
.body1{background: red;}
}
table{
border:none ; background: #e4e3e3;
}
</style>
推荐阅读
- node.js - 如何检查文档的某个字段是否存在于 Firebase 中?
- doctrine - 如何设置学说结果的生命周期和全局查询缓存?
- java - 在 Firestore 中找不到文档数据,返回 null
- wordpress - 如何计算一个月前的作者帖子
- ruby-on-rails - 如何在我的 Rails 项目中公开原始 ruby 文件(带插值)?
- sql-server - 为按日期和小时过滤的查询优化表?
- machine-learning - 强化学习文献中的“软”是什么意思?
- javascript - ASP 菜单:如何避免回发并使用 Javascript 客户端脚本访问选定的值
- angular - 在 Angular 中重新渲染视图模板的差异 Observable 等待和 setTimeout
- tensorflow - 将 AutoML Tables 生成的模型导入 BigQuery ML 会引发错误“Op type not registered 'DecodeProtoSparseV2'”