我正在寻找一种方式显示/隐藏电子邮件通讯的内容,基于设备,客户打开电子邮件。
目前,我在head部分获得了以下代码片段:
@media only screen and (max-width: 480px) {
#mobile { display: block; } /* show it on small screens */
#normal { display: none; } /* hide it elsewhere */
}
@media only screen and (min-width: 481px) {
#mobile { display: none; }
在使用@media显示屏幕分辨率css后,如何显示已被按钮隐藏的div/class。这是按钮的代码:
<script>
var button = document.getElementById('answer');
function showDiv() {
var div = document.getElementById('displayfilter');
if (div.style.display !== 'none') {
div.style.display = 'none';
}