我在使用 Gmail 时遇到了一些 CSS 问题。我的 HTML 电子邮件响应迅速,在 iPhone 上运行良好,但在发送到 Gmail 时,它显示“mobile_toolbar”和“full_toolbar”。我需要摆脱移动工具栏,以便为 Gmail 桌面版正确格式化电子邮件。
我已经尝试过使用 display:none !important 但它不起作用。
谢谢!
CSS:
<style type="text/css">
.ReadMsgBody {width: 100%; background-color: #ffffff;}
.ExternalClass {width: 100%; background-color: #ffffff;}
body {width: 100%; background-color: #ffffff; margin:0; padding:0; -webkit-font-smoothing: antialiased;font-family:Arial}
table {border-collapse: collapse;}
p {font-family: Arial, serif;}
a {font-family: Arial, serif;}
@media only screen and (max-width: 640px) {
body[yahoo] .deviceWidth {width:440px!important; padding:0;}
body[yahoo] .center {text-align: center!important;}
#full_toolbar {display:none !important;}
#mobile_toolbar {display:block; background:white;}
#mobile_toolbar a {text-decoration:none;}
}
@media only screen and (max-width: 479px) {
body[yahoo] .deviceWidth {width:280px!important; padding:0;}
body[yahoo] .center {text-align: center!important;}
}
@media screen and (min-width: 641px) and (max-width: 1920px) {
*[id=mobile_toolbar] {
display:none!important;
overflow:hidden!important;
}
}
HTML:
<div id="full_toolbar"><img usemap="#toolbar" class="deviceWidth" src="images/main_toolbar.jpg" alt="" style="display: block; border-radius: 4px;" border="0">
<div id="mobile_toolbar" >
<a href="#"><div style="margin-bottom: 5px; width:100%; height:100%; color:black; background:#a4a4a4; font-weight: bold;">New Inventory</div>
<a href="#"><div style="margin-bottom: 5px; width:100%; color:black; background:#a4a4a4; font-weight: bold;">Used Inventory</div>
<a href="#"><div style="margin-bottom: 5px; width:100%; color:black; background:#a4a4a4; font-weight: bold;">Services</div>
<a href="#"><div style="margin-bottom: 5px; width:100%; color:black; background:#a4a4a4; font-weight: bold;">Directions</div>
<a href="#"><div style="margin-bottom: 5px; width:100%; color:black; background:#a4a4a4; font-weight: bold;">Contact</div>
<a href="#"><img src="images/twitter.jpg"></a> <a href="#"><img src="images/facebook.jpg"> </a><a href="#"><img src="images/youtube.jpg"></a> <a href="#"><img src="images/google.jpg"></a>
</div>