代码之家  ›  专栏  ›  技术社区  ›  Anjali

并排显示按钮而不是堆叠

  •  0
  • Anjali  · 技术社区  · 5 年前

    enter image description here

    我要删除和取消按钮并排。以下是我的代码:

         <div >
                                        <p style="width:200px;height:100px;margin-right:auto;margin-left:auto">
                                            <asp:Button ID="OkButton" runat="server"  Text="Remove"  CommandName="delete" CommandArgument='<%#Eval("CartID") %>'/>
                                            <asp:Button ID="CancelButton"  runat="server" Text="Cancel" />
                                        </p>
       </div>   
    
        
    
    1 回复  |  直到 5 年前
        1
  •  1
  •   Sena    5 年前

    尝试使用DisplayFlex

    p {
      display: flex;
      align-items: center;
      justify-content: center;
    }
    
    p Button {
      width: 100px;
      height: 100px;
      border: 1px solid red;
    }
      
      
    

    过来看 https://jsfiddle.net/L95j0kd7/1/