XUL设置了工具栏按钮的宽度

时间:2013-10-13 00:45:15

标签: firefox firefox-addon xul

如何设置工具栏按钮的宽度? 我已经在XUL中设置它并尝试使用js,但这些方法都不能使用

document.....setAttribute("style","width:50px")

我该怎么做?

感谢。

1 个答案:

答案 0 :(得分:1)

有这样的事情:

<toolbarpalette id="BrowserToolbarPalette">
   <toolbarbutton id="toolbarbuttonID"
      image='chrome://yourExt/content/images/logo.png'
      class="toolbarbutton-1 chromeclass-toolbar-additional"
   </toolbarbutton>
</toolbarpalette>

您可以在css文件中设置图像大小:

#toolbarbuttonID .toolbarbutton-icon {
   width: 50px
   height:16px
}

如果需要,您还可以添加所需高度和宽度的图像,并将其添加为按钮的图像。它会拉伸按钮的大小: