【问题标题】:Align buttons in the td element to right将 td 元素中的按钮右对齐
【发布时间】:2015-12-19 11:36:08
【问题描述】:

具有以下 html 结构。我想在右对齐的 td 元素中显示按钮。尝试浮动:就在css中。但没有变化。请让我知道我在哪里犯错。在此先感谢

<div id="saveResetDiv" class ="saveReset" style="display: none;">
     <table id ="tableSaveReset">
     <tbody>
     <tr id ="buttonSaveReset" class= "buttonSaveReset">
     <td class= "save"  align= "right" ><button id="saveButton" class="save" bgcolor="#FF0000" >Save</button></td>
     <td class= "reset" align= "right"><button id="resetButton" bgcolor="#FF0000">Reset</button></td>
     </tbody>

     </table>
      </div>

【问题讨论】:

标签: html css-float


【解决方案1】:

在 CSS 中使用 float: right 属性

【讨论】:

  • 在 jsfiddle 中分享你的 sn-p
  • 将 !important 属性赋予您的 css 类
【解决方案2】:

首先给表格一些宽度。

然后就可以使用了,

浮动:右(或)对齐:右

【讨论】:

    【解决方案3】:

    你只能把两个按钮左对齐或右对齐

    【讨论】:

    • 您可以通过编写代码 sn-p 来改进您的答案。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-05-10
    • 1970-01-01
    • 2014-12-17
    • 2012-03-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多