我被困在解决这个问题上。
它的工作原理,它可以在移动 View 中隐藏横幅。但有些地方不对劲。横幅显示在我的内容网站后面。它看起来像横幅将成为我网站的背景。
请任何人帮助我。
#largeAds {
width:728px;
height: 90px;
line-height: 90px;
margin: 0 auto;
background: #ccc;
text-align: center;
}
#smallAds{
display: none;
margin: 0 auto;
width: 468px;
height: 60px;
line-height: 60px;
background: #333;
color: #fff;
text-align: center;
}
@media screen and (max-width: 750px) {
#largeAds { display: none }
#smallAds{display: block;}
}
<div id="largeAds">Large ads (728 x 90)</div>
<div id="smallAds">Small ads (468 x 60)</div>
最佳答案
希望对您有所帮助!
@media only screen and (max-width: 720px) {
#largeAds { display: none ! important }
#smallAds{display: block; ! important}
}
关于javascript - 在移动 View 中隐藏广告横幅,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45293888/