【问题标题】:Mobile conditional tags for blogger responsive template博客响应模板的移动条件标签
【发布时间】:2014-06-14 20:46:18
【问题描述】:

如果我不想在 blogger mobile 中显示元素,我可以在 blogger 条件标签中使用 true 或 false 语句。

<b:if cond='data:blog.isMobile == &quot;false&quot;'> //Contents inside this, will only appear in Desktop version. </b:if>

但是有什么办法可以在手机中以特定分辨率激活元素; e.i: (240*320)?或者,有什么方法可以使不支持 adsense 的低级浏览器的特定元素无效(例如:Opera Mini for 240*320)?

【问题讨论】:

    标签: blogger blogspot


    【解决方案1】:

    没有本机博客标签来阻止为小屏幕呈现广告。

    但您可以使用 CSS3 媒体查询将广告隐藏在较小的屏幕中。

    向 adsense 广告块添加唯一 ID 或类名。

    例如:

    <div id="mobileAdsenseAds">
    
      // your adsense ad code here
    
    </div>
    

    如果您使用博客小工具添加了广告,那么您可以通过查看 EDIT HTML 选项卡或在浏览器中查看源代码来获取 CSS ID。

    在 CSS 中:

    @media all and (max-width: 240px) {
    
      /* For hiding adsense ads */
      #mobileAdsenseAds { 
         display: none; 
      }
    
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-04-23
      • 2018-07-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-08-06
      相关资源
      最近更新 更多