对齐 .aspx 按钮

我有一个更新面板,其中包含一个标签、一个 dropDownList 和两个按钮:

 <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <div id="dropDownList" style="position:relative;" runat="server">
            <label>
                    Select New File: </label>
                    <div id="ddl" runat="server">
                <asp:DropDownList runat="server" ID="ddlCaseFiles" DataSourceID="dsMyCaseFiles" DataTextField="Display"
                    DataValueField="FileID" OnPreRender="ddl_PreRender" Width="524px" OnSelectedIndexChanged="ddlCaseFiles_SelectedIndexChanged" />
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="ddlCaseFiles"
                    ToolTip="Casefile Required" InitialValue="-1" Text="*" Display="Dynamic" />
                <ajaxToolkit:ListSearchExtender ID="ddlExtCaseFiles" runat="server" PromptCssClass="ListSearchExtenderPrompt"
                    TargetControlID="ddlCaseFiles" BehaviorID="ddlExtCaseFiles" Enabled="True" />
                    </div>
                <br />
                <asp:Button ID="btnMoveCaseFile" runat="server" Text="" 
                   style="float:left;" onclick="btnMoveCaseFile_Click"/>
                <asp:Button ID="btnCancel" runat="server" Text="Cancel" 
                   style="float:right" onclick="btnCancel_Click"/>
                   <br />
            </div>
                   <asp:Label runat="server" ID="lblStatus"></asp:Label>
        </ContentTemplate>

我试图让我的按钮像这样排列:(DropDownList 开头的按钮和结尾的按钮) enter image description here

我试过浮动绝对等。

stack overflow Aligning .aspx buttons
原文答案

答案:

作者头像

我想到了。好像你必须在数字后添加 px .....

 <asp:Button ID="btnMoveCaseFile" runat="server" Text="" 
                   style="position:absolute; float:left; margin-left:104px;" onclick="btnMoveCaseFile_Click"/>
                <asp:Button ID="btnCancel" runat="server" Text="Cancel" 
                   style="position:relative; float:right; margin-right:63px;"

因为我有 margin-right:63;而不是 margin-right:63px;