【问题标题】:Nested Classes in HTMLHTML 中的嵌套类
【发布时间】:2016-07-05 05:47:50
【问题描述】:

所以我试图在较大的屏幕上显示类col-md-3,并在带有侧面菜单的小屏幕上显示类pure-container。侧面菜单的内容应该定期显示在没有hamburger pan 的大屏幕上,但在较小的屏幕上它应该包含在hamburger 菜单中。

较大的屏幕尺寸适合内容,较小的屏幕尺寸显示侧边菜单但缺少内容,有什么建议吗?我尝试将content visible-xs visible-sm 包含在pure-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>

【问题讨论】:

    标签: javascript html css class nested


    【解决方案1】:

    这是因为您使用了include_once,它可以防止相同的代码被渲染两次。结果,您的pure_drawer 实际上是空的。

    你可以改变

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

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

    为了在两个容器中呈现新闻列表。

    【讨论】:

    • 是的!那行得通!我一直在到处找这个,非常感谢!我想我没有考虑到这一点。非常感谢。真的。
    猜你喜欢
    • 1970-01-01
    • 2015-04-30
    • 2022-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-23
    • 2019-07-06
    相关资源
    最近更新 更多