为什么当我添加 CSS 文件时,我的列表中去掉了“YouTube”物品?

发布于 2024-09-19 12:06:03 字数 1090 浏览 3 评论 0原文

ma​​in.xul

<?xml version="1.0"?>
<?xml-stylesheet href="main.css" type="text/css"?>

<window id="main" class="MainClass" title="MY TEST" width="640" height="480" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
    <listbox id="mainList" flex="1" class="MainListbox">
        <listitem label="Twitter"/>
        <listitem label="YouTube" id="youtubeID" class="YoutubeClass" oncommand="document.getElementById('youtubeID').startYoutube()"/>
    </listbox>
</window>

ma​​in.css

.YoutubeClass {
 -moz-binding: url("main.xml#youtubeStarter");
}

ma​​in.xml

<?xml version="1.0"?>

<bindings xmlns="http://www.mozilla.org/xbl">
    <binding id="youtubeStarter">
            <!-- empty -->
    </binding>
</bindings>

如果我删除 -moz-binding: url('main.xml#youtubeStarter '); 从 CSS 中,Youtube 项目显示出来。知道为什么这一行 Youtube 项目会隐藏吗?

main.xul

<?xml version="1.0"?>
<?xml-stylesheet href="main.css" type="text/css"?>

<window id="main" class="MainClass" title="MY TEST" width="640" height="480" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
    <listbox id="mainList" flex="1" class="MainListbox">
        <listitem label="Twitter"/>
        <listitem label="YouTube" id="youtubeID" class="YoutubeClass" oncommand="document.getElementById('youtubeID').startYoutube()"/>
    </listbox>
</window>

main.css

.YoutubeClass {
 -moz-binding: url("main.xml#youtubeStarter");
}

main.xml

<?xml version="1.0"?>

<bindings xmlns="http://www.mozilla.org/xbl">
    <binding id="youtubeStarter">
            <!-- empty -->
    </binding>
</bindings>

If I delete the -moz-binding: url('main.xml#youtubeStarter'); from the CSS, the Youtube item shows up.. Any idea why with this line the Youtube item hides?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

天邊彩虹 2024-09-26 12:06:03

明白了:当您添加绑定(在 css 中使用 -moz-binding)时,它将使用绑定标记中指定的内容覆盖该组件的内容。如果您没有标签(我的情况),您将没有内容。

Got it: when you add a binding (with -moz-binding in css) it will override the content of that component with the content specified in the tag of the binding. If you do not have a tag (my case) you will have no content.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文