2013-06-12 34 views
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> 

回答

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

我認爲,這將讓你非常接近你想要什麼。