【问题标题】:making firefox extension toolbar element aligned to the right使Firefox扩展工具栏元素向右对齐
【发布时间】:2011-12-04 06:29:50
【问题描述】:

所以我有这个代码:

   <toolbox id="navigator-toolbox">
      <toolbar id="abar" accesskey="T"
              class="chromeclass-toolbar" context="toolbar-context-menu"
              hidden="false" persist="hidden">
        <toolbarbutton id="ahah-b"
            label="hahaa" class="toolbarbutton-1 chromeclass-toolbar-additional custombutton" />
         <textbox id="search" />
         <toolbarbutton id="search-b" label="Search" oncommand="search()" />
      </toolbar>
   </toolbox>

但是使用此代码,所有内容都会在工具栏中左对齐。是否可以让“ahah-b”工具栏按钮左对齐而“搜索”文本框和“搜索-b”按钮右对齐?

【问题讨论】:

  • :如果你使用flex属性元素和盒子元素,这将非常简单。 developer.mozilla.org/en/XUL_Tutorial/Element_Positioning>

标签: html firefox firefox-addon xul


【解决方案1】:

如果你还在找答案,你要的属性不是align,是pack。 Mozilla Dev Network Docs - Pack

来自我正在开发的迷你站点特定浏览器的示例:

<toolbar id="nav-toolbar" pack='end'>
  <toolbarbutton image="images/back.png" />
  <toolbarbutton image="images/next.png" />
</toolbar>

Screenshot

【讨论】:

    【解决方案2】:

    align='end' 添加到toolbar 应该可以工作。见https://developer.mozilla.org/en/XUL/Attribute/align

    【讨论】:

      猜你喜欢
      • 2012-12-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多