小编Chl*_*ews的帖子

为什么我的边距 css 在我的媒体查询中不起作用?

我正在尝试创建一个电子邮件签名,当在移动设备上时,文本顶部与照片对齐。在桌面版本上,我的上边距为 32px,媒体查询为 0px。任何线索为什么我的媒体查询不起作用?

@media only screen and (max-width: 500px) {
  .mobile {
    visibility: hidden;
    display: none;
  }

  .mtext {
    margin-top:0px; !important
    padding:0px; !important
  }
}
Run Code Online (Sandbox Code Playgroud)
<table width="100%" border="0" style="font-family:Arial, Helvetica,sans-serif;font-size:12px; margin-left:10px; margin-right:10px;">
   <tr>
      <td width="100" valign="top" align="left">
         <img width="100px" src="https://www.pkallsc.org/wp-content/uploads/2018/04/Headshot-Jeffrey-Ashley-square-e1522622432938.jpg"  style="float:left;" alt="John Smith" />
      </td>
      <td width="1249" valign="top" style="text-align:left; margin-left:5px; font-family:Arial, Helvetica, sans-serif; font-size:16px;" align="left">
         <p class="mtext" style="margin-left:10px; margin-top:32px; font-family:Arial, Helvetica, sans-serif; font-size:14px; text-align:left;"> <strong>John&nbsp;Smith</strong>
            <br />Chief Executive Officer<br /> 123 Central Suite, Suite 510 |&nbsp;Alpharetta, Georgia 30022<br /> T …
Run Code Online (Sandbox Code Playgroud)

css margin

2
推荐指数
1
解决办法
1738
查看次数

标签 统计

css ×1

margin ×1