2

我有造型问题

我正在尝试将按钮与位于正下方的 gridview 的第一列对齐。

像这样的东西:

像这样的东西

我已经完成了以下操作,但显然它会因不同的分辨率而失败:

<div class="formsFormBlock">
     <asp:Label ID="LblRecurError" runat="server" />
     <div style="text-align: left; position: relative; left: -15%;">
          <table style="border: 0">
               <tr>
                    <td style="border: 0">
                        <asp:Button ID="btnRecur" runat="server" Text="Repeat" />
                    </td>
               </tr>
          </table>
    </div>
<asp:GridView>
</asp:GridView>

我怎样才能做到这一点?

添加:

gridview 没有 cssclass 但上面的 div 具有以下 css 属性:

.formsFormBlock{clear:both;position:relative;border-bottom:1px solid #e8f1f7;padding:0.53em 0.83em}
.formsFormBlock .formsItemLabel{display:block;width:25%;float:left;position:relative}
.formsFormBlock .formsItemLabel em{position:absolute;/*right:1.66em*/color:#ff0000}
.formsFormBlock .formsFormBlockHint{color:#999;font-size:92%;}

#formsFormHd:after, .formsFormBlock:after{content:".";display:block;height:0;clear:both;visibility:hidden;}
#formsFormHd, .formsFormBlock{display:block;clear:both;}
*:first-child+html #formsFormHd, *:first-child+html .formsFormBlock{display:inline-block;}
4

2 回答 2

2

尝试这个

<div class="formsFormBlock">
     <div style="text-align: left; position: relative; left: -15%;">
          <table style="border: 0">
               <tr>
                    <td style="border: 0">
                        <asp:Button ID="btnRecur" runat="server" Text="Repeat" />
                         <asp:Label ID="LblRecurError" runat="server" />
                    </td>
               </tr>
          </table>
    </div>
<asp:GridView>
</asp:GridView>
于 2013-05-23T07:11:38.547 回答
1
   <div id="container">
        <div style="float: left; margin-bottom: 10px;">
            <asp:Label ID="LblRecurError" runat="server" />
            <br />
            <asp:Button ID="btnRecur" runat="server" Text="Repeat" />
        </div>
        <div style="clear: left;">
            <asp:GridView runat="server">
            </asp:GridView>
        </div>
    </div>

干杯

于 2013-05-23T07:14:59.193 回答