两个按钮和文本与不同的对齐

时间:2013-10-04 20:56:42

标签: html css alignment

我有popup.htlm文件的代码:

HTML

<body>
   <select style="width: 100%;"
      multiple id="HLSlist">
   </select>
   <span style="display:inline">
      <button type="button" id="Deletebut">Delete</button>
      <button type="button" id="OpenAllbut">Open All</button>
      <t id='VFlagged'>0</t>
   </span>
   <hr>
   <input type="checkbox" id="BlurThumbs">
   <t>Blur Thumbnails</t>
</body>

CSS

body {
    overflow-x: hidden;
    min-width: 200px;
}

t {
    font-size: 10pt;
}

我希望文字显示在右侧,如图所示: enter image description here

1 个答案:

答案 0 :(得分:1)

你可以简单地漂浮它。

jsFiddle here - 它有你期望的结果。

#VFlagged {
    float: right;
    padding-right: 10px;
}

可能需要一些填充 - 我添加了10px ..

另外..我将t元素更改为span ..