2

我有 asp.net 按钮、表格和按钮,如下所示:

<table style="width: 600px;">
    <tr>
        <td>
            <div style="float: right;">
                <asp:Button ID="_btn01" runat="server" Text="GO" />
                <table class="IHCommandButtonContainer" cellpadding="0" cellspacing="0">
                    <tr>
                        <td class="IHCommandButtonL"><asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="/Test/Images/btn_Search.gif" /></td>
                        <td class="IHCommandButtonM"><span>Search</span></td>
                        <td class="IHCommandButtonR"><img src="/Test/Images/btn_R.gif" /></td>
                    </tr>
                </table>
                <asp:Button ID="Button1" runat="server" Text="GO" />
            </div>
        </td>
    </tr>
</table>

问题是我不能把它们放在同一行。它们如下所示:

在此处输入图像描述

我的CSS如下:

<style type="text/css">
    .IHCommandButtonContainer   { height: 21px; border: 0px; display: inline-block; cursor: pointer; margin: 0px; padding: 0px; border-spacing: 0px; border-collapse: collapse; }
    .IHCommandButtonL           { width: 22px; height: 21px; }
    .IHCommandButtonL   input   { width: 22px; height: 21px; }
    .IHCommandButtonM           { background-image: url(/Test/Images/btn_M.gif); height: 21px; font-size: 9pt; font-family: Sans-serif, Arial, Dotum; }
    .IHCommandButtonM   span    { margin: 0px 2px 0px 0px; }
    .IHCommandButtonM_          { background-image: url(/Test/Images/btn_M_.gif); height: 21px; font-size: 9pt; font-family: Sans-serif, Arial, Dotum; }
    .IHCommandButtonM_  span    { margin: 0px 2px 0px 0px; }
    .IHCommandButtonR           { width: 3px; height: 21px; }
    .IHCommandButtonR   img     { width: 3px; height: 21px; cursor: pointer; }
</style>

我怎样才能把它们放在同一行?像 2 个 GO 按钮在同一行,但中间的表格比它们高。

4

2 回答 2

1

您的 css 中的用户“垂直对齐”属性。将值设置为“中间”。

干杯

于 2012-09-09T04:37:55.780 回答
-1

垂直对齐是正确的答案,尽管我反对使用“开发人员工具”......诀窍是了解你在做什么......

这会帮助你: http: //phrogz.net/css/vertical-align/index.html

请注意,将按钮放在“显示:内联块”中将帮助您轻松解决此问题!

于 2012-09-09T08:43:35.080 回答