2013-06-12 3 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; 
} 

Я думаю, что вы получите очень близко к тому, что вы хотите.

Смежные вопросы