多行复选框文本格式

时间:2013-06-12 23:28:15

标签: asp.net xml

我有一个长文本复选框(约5或6行)。我试图让文本缩进并在包装时很好地对齐。我目前的代码目前在IE中运行,但在Chrome,Safari,FireFox中,文本与复选框的行不同。有谁知道我在这里做错了什么或有任何其他方法来实现这一目标?感谢您提前提供任何帮助!

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Info.ascx.cs"
Inherits="Project.Info" %>
<style type="text/css">
.CkbxFormat input
{
    float: left;
}
.CkbxFormat label
{
    display: inline-block;
}
</style>
<div style="margin-top: 10px; margin-left: 50px;">
<asp:Table ID="Table1" runat="server" Width="700px" CellSpacing="2" CellPadding="5"
    Style="border: Solid 1px green;">
    <asp:TableRow>
        <asp:TableCell>
            <asp:Label ID="Label1" runat="server" Text="Information"></asp:Label>
        </asp:TableCell></asp:TableRow>
    <asp:TableRow>
        <asp:TableCell>
            <asp:CheckBox ID="CkBxInfo" runat="server" Text="The accessor of a property contains the executable statements associated with getting (reading or computing) or setting (writing) the property. The accessor declarations can contain a get accessor, a set accessor, or both.  The body of the get accessor is similar to that of a method. It must return a value of the property type. The execution of the get accessor is equivalent to reading the value of the field. " CssClass="CkbxFormat"></asp:CheckBox>
        </asp:TableCell></asp:TableRow>
</asp:Table>
</div>

1 个答案:

答案 0 :(得分:0)

尝试使用CSS:

.CkbxFormat label {
    display: block;
    padding-left: 15px;
    text-indent: -15px;
}
.CkbxFormat input {
    width: 13px;
    height: 13px;
    padding: 0;
    margin:0;
    vertical-align: bottom;
    position: relative;
    top: -1px;
    *overflow: hidden;
}

我认为这会让你非常接近你想要的东西。