手风琴按钮位置

时间:2015-01-28 20:31:02

标签: html css

我正在尝试将BM按钮放在最右边的标题部分以消除一行。这是我的代码:

<div id="accordion">
  <h3>
      <div>
      <div contenteditable="true">
           <text> f1 </text>|
           <text> bs1 </text>|
           <text> bt1 </text>|
      </div>
      <button type="button">BM</button>
          </div>
    </h3>
  <div>
      <input type="checkbox" name="animal" value="C" checked="true"/>W1 <br />
      <input type="checkbox" name="animal" value="D" />W2<br />
      <input type="checkbox" name="animal" value="B" />w3<br />


  </div>

http://jsfiddle.net/nez52khy/

我也可以编辑下面的代码,但是,一旦我尝试编辑文本,按钮也会显示在div元素中。 http://jsfiddle.net/c7xhykmL/

1 个答案:

答案 0 :(得分:1)

&#13;
&#13;
<div id="accordion">
    <h3>
        <div>
            <div contenteditable="true" style="display:inline-block;">
                <text> f1 </text>|
                <text> bs1 </text>|
                <text> bt1 </text>|
            </div>
            <button type="button" style="float:right;">BM</button>
        </div>
    </h3>
    <div>
        <input type="checkbox" name="animal" value="C" checked="true"/>W1 <br />
        <input type="checkbox" name="animal" value="D" />W2<br />
        <input type="checkbox" name="animal" value="B" />w3<br />
    </div>
</div>
&#13;
&#13;
&#13;