基金会< nav data-topbar>不允许写入< section>到< div> [英] Foundation <nav data-topbar> disallows writing a <section> into <div>

查看:159
本文介绍了基金会< nav data-topbar>不允许写入< section>到< div>的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是行为预期还是bug?



当使用Zurb Foundation 5的顶部组件时,呈现的HTML不允许我放置一个« ;节&RAQUO;标记在« div» ;.我已经解决了足够的问题,只有在将data-topbar属性添加到< nav»时,才会发生这种情况。我可以添加一个« ul»元素在« div»并使其正确渲染。但是,< section class =tob-bar-section»正在与我战斗。

写入文件的标记:

 < nav data-topbar = 顶栏 > 
< div>
< section>< / section>
< / div>
< / nav>

浏览器呈现的标记(FF / Chrome):

 < nav data-topbar =topbar> 
< div>< / div>
< section>< / section>
< / nav>

感谢您的帮助!

解决方案

它可能不是最经典的解决方案,但看到无论我重写我的应用程序的路线是什么,这个问题都是持久的。



  topBarReposition:function(){
var topbar = $(。header_wrap .top-bar-section),
sibling = $(。header_wrap .row ul);

$(sibling).after(topbar);
}


Is this behaviour expected, or a bug?

When using Zurb Foundation 5's top-bar component, the rendered HTML is doesn't allow me to put a «section» tag inside of a «div». I have troubleshooted enough to know that this only occurs when you add the data-topbar attribute to the «nav». I am able to add a «ul» element in the «div» and have it render properly. However, the «section class="tob-bar-section"» is fighting me.

Markup written to file:

<nav data-topbar="topbar">
    <div>
      <section></section>
    </div>
</nav>

Markup rendered by browsers (FF/Chrome):

<nav data-topbar="topbar">
    <div></div>
    <section></section>
</nav>

Thank you for any help!

解决方案

It may not be the classiest solution, but seeing as no matter what route I took short of rewriting my app, this problem was persistent.

Instead of fighting it, I just moved the section on it's own.

topBarReposition: function () {
    var topbar = $(".header_wrap .top-bar-section"),
        sibling = $(".header_wrap .row ul");

    $(sibling).after(topbar);
}

这篇关于基金会&lt; nav data-topbar&gt;不允许写入&lt; section&gt;到&lt; div&gt;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆