2016-07-05 102 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