在下面的gridview的第一列上方对齐asp:Button

时间:2013-05-23 06:43:36

标签: html asp.net css

我有造型问题

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

这样的事情:

Something like this

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

<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;}

2 个答案:

答案 0 :(得分: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>

答案 1 :(得分: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>

欢呼声