css - 删除 XUL menuitem 中的图像/图标空间和 menupopup 中的垂直线

标签 css firefox-addon xul

enter image description here

我有一个 menupopup,当它在 Firefox 6.0.2 的 Windows 7 上使用时,它会在左侧显示一些空间。但是当与 Firefox 4 和 Windows XP 一起使用时不显示左侧空间。如何删除左边的空格?

<toolbarbutton id="search" type="menu" label="SEARCH" width="83" height="25" oncommand="webSearch();event.stopPropagation();">              
    <menupopup>
        <menuitem label="Web" value="webs" oncommand="webSearch();event.stopPropagation();" />
        <menuitem label="Images" value="images" oncommand="imageSearch();event.stopPropagation();"/>
        <menuitem label="News" value="news" oncommand="newsSearch();event.stopPropagation();" />
        <menuitem label="Video" value="videos" oncommand="videoSearch();event.stopPropagation();"/>
    </menupopup>
</toolbarbutton>

menuitem 应该位于弹出窗口的中央。此外,在显示的 label 之前有一条细线(查看上面的屏幕截图)。我想删除该行。

最佳答案

<?xml version="1.0"?>
        <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
        <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
        <row>
        <toolbarbutton id="search" type="menu" label="SEARCH" width="83" height="25" oncommand="webSearch();event.stopPropagation();">             
                <menupopup id="editItems" position="after_pointer">
                    <menuitem label="Web" value="webs" oncommand="webSearch();event.stopPropagation();" />
                    <menuitem label="Images" value="images" oncommand="imageSearch();event.stopPropagation();"/>
                    <menuitem label="News" value="news" oncommand="newsSearch();event.stopPropagation();" />
                    <menuitem label="Video" value="videos" oncommand="videoSearch();event.stopPropagation();"/>
                  </menupopup>
        </toolbarbutton>
        </row>
        </window>

根据文档,您不能定位在中心,但我希望您在一行内使用工具栏按钮,然后使用任何一个定位属性。

https://developer.mozilla.org/en/XUL/PopupGuide/Positioning https://developer.mozilla.org/en/XUL/menupopup https://developer.mozilla.org/en/images,_tables,_and_mysterious_gaps

请参阅这些链接以获取更多信息。

关于css - 删除 XUL menuitem 中的图像/图标空间和 menupopup 中的垂直线,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7467630/

相关文章:

html - 一个 Firefox 插件,用于显示元素侧面与其父元素之间的距离

javascript - 在同一窗口的新选项卡中打开链接

html - 选择在模板页面上使用 # vs class

php - WordPress 自定义下拉菜单

css - 如何使用 React 多次添加相同的 CSS 属性(例如背景图像)?

javascript - Firefox 扩展上独立于选项卡的 jQuery

javascript - Firefox 附加组件开发 |重写browser.xul

jQuery + Css - 动态添加 css 到列表项

javascript - Firefox 扩展 - 突出显示文本时调用函数

javascript - 如何在获得焦点时使用 css 使 Xul 按钮变大?