如何在不同标签中的标签和文本框之间留出空间C#Web App?

时间:2011-08-26 04:09:57

标签: c# asp.net html alignment

我试图在标签和文本框之间给出一个两位数的空格,它们都在一行表格中的不同td标签中,这样标签就是右对齐而文本框是左对齐的,所以它们接近我想给两位数的空格之间而不是alin然后中间?我的代码如下,

<table>
 <tr>
            <td align="right" class="style5">
                <asp:Label ID="Label2" runat="server" Text="Link:" ForeColor="Black" ></asp:Label>
            </td>
            <td class="style5">
                <asp:TextBox ID="Link" runat="server"> </asp:TextBox>
            </td>
        </tr>
</table>

我正在使用:在这两个控件之间留出空间,但我不想使用:相反,那么解决方案是什么

希望你的建议..

2 个答案:

答案 0 :(得分:4)

使用CSS:

td.style5 { padding-right: 1em; }

答案 1 :(得分:0)

你可以申请margin-left:1em;在文本框div。