【发布时间】:2015-07-23 19:21:33
【问题描述】:
我的桌面网站主题上有一个可点击的 javascript 链接 (Trustwave),我试图在移动屏幕上禁用它:
在footer.tpl:
<div style="position:absolute; margin-left:100px; margin-top:50px">
<script type="text/javascript" src="https://sealserver.trustwave.com/seal.js?style=invert"></script>
我现在知道如何删除移动屏幕上的可点击图片链接 (Remove image link in mobile screen),例如:
在footer.tpl:
<div class="column">
<a href="http://mywebsite.com/delivery" id="test" class="hide"></a>
在 stylesheet.tpl 中:
@media all and (max-width: 480px) {
.hide {
display: none;
}
}
#test {
display: block;
background-image: url('../image/myimage.png');
background-repeat: no-repeat;
position: absolute;
margin-top: 10px;
margin-left: 20px;
width: 75px;
height: 75px;
}
但我不知道如何重新创建 javascript 链接,使其不会显示在移动屏幕上。提前致谢!
【问题讨论】:
-
尝试将您的媒体查询切换到
max-device-width: 640px。max-width很难依赖,现在智能手机上的分辨率更高了。 -
把媒体查询放在最后。因为看起来您正在使用#test css 规则覆盖显示属性。
标签: javascript html css