0

我有一个带有长文本(大约 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>
4

1 回答 1

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

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

于 2013-06-13T02:50:22.207 回答