2016-07-05 45 views
0

所以我试图在较小的屏幕上使用侧边菜单显示较大屏幕类col-md-3和类pure-container。侧面菜单的内容应该在没有hamburger平底锅的大屏幕上定期显示,但在较小的屏幕上,它应该包含在hamburger菜单中。HTML中的嵌套类

较大的屏幕尺寸对内容工作正常,较小的屏幕尺寸显示侧边菜单,但缺少内容,有什么建议?我试图包括content visible-xs visible-smpure-drawer但它不起作用,我也试过媒体查询。

这里是代码。

<div class="col-md-3 content visible-md visible-lg"> 
    <?php include_once 'helper/block_news_list.php'; ?> 
</div> 

<!-- Begining of the pure-drawer --> 
<div class="pure-container" data-effect="pure-effect-push"> 
    <input type="checkbox" id="pure-toggle-left" class="pure-toggle" data-toggle="left" /> 
    <label class="pure-toggle-label" for="pure-toggle-left" data-toggle-label="left"><span class="pure-toggle-icon"></span></label> 

    <nav class="pure-drawer" data-position="left"> 
    <br> 
    <br> 
    <br> 
    <p style="padding: 10px 20px; margin: 0;"> 
     <?php include_once 'helper/block_news_list.php'; ?> 
    </p> 
    </nav> 
</div> 

回答

2

这是因为你使用include_once防止相同的代码来渲染两次。因此,您的pure_drawer实际上是空的。

您可以更改

<?php include_once 'helper/block_news_list.php'; ?> 

<?php include 'helper/block_news_list.php'; ?> 

,以使在两个容器新闻列表。

+1

是的!这工作!我一直在寻找这个,非常感谢你!我想我没有考虑到这一点。非常感谢。真。 – Ubiq