1

私は順不同のリストを持っています:

<ul class="list_arrow2">
    <li>
        <span style="display: inline-block; width: 150px; font-weight: bold;">
            Signup Options </span>&ndash; &nbsp; Describe your signup options 
            that an applicant can choose from. List the signup option type, 
            description, and price. For example, the two signup options might be 
            Customer or Distributor; each option would carry a different description 
            of cost and details.
    </li>
    <li>
        <span style="display: inline-block; width: 150px; font-weight: bold;">
            Order Options </span>&ndash; &nbsp; Indicate any additional purchase 
            options that an applicant may have. This may be in the form of a single 
            item or package item order. For example, you might want to give the 
            applicant a choice to purchase a "starter kit" that includes various 
            products that you sell. Be sure to list the details of these items, 
            including a description and price.
    </li>
    <li>
        <span style="display: inline-block; width: 150px; font-weight: bold;">
            Autoship Options </span>&ndash; &nbsp; This section can be exclusive 
            of the Order Options section or you can include both. The Autoship 
            section is just like the Order Options section except that the applicant 
            is agreeing to receive the order on an monthly, recurring basis. Be 
            sure to include descriptions, pricing, etc.
    </li>
    <li>
        <span style="display: inline-block; width: 150px; font-weight: bold;">
            Payment Options </span>&ndash; &nbsp; List the types of credit cards 
            you accept (Visa, M/C, AMEX, Diners). Also, if you intend on taking 
            personal checks online, or ACH, be sure to add this to your details. 
            If you plan on taking online checks, or ACH, please contact your Account 
            Manager for more details on getting this set up.
    </li>
    <li>
        <span style="display: inline-block; width: 150px; font-weight: bold;">
            Terms and Conditions</span>&ndash; &nbsp; Please provide the full text 
            of your terms and conditions and/or Distributor Agreement. This will 
            be displayed for the applicant to agree to before proceeding with 
            their registration.
    </li>
    <li>
        <span style="display: inline-block; width: 150px; font-weight: bold;">
            Confirmation Message </span>&ndash; &nbsp; Please provide us with 
            the text that is displayed once the applicant successfully signs up. 
            This text is also emailed to the new applicant.
    </li>
    <li>
        <span style="display: inline-block; width: 150px; font-weight: bold;">
            Welcome Message </span>&ndash; &nbsp; Please provide us with the text 
            that is displayed as an introduction to the applicant.
    </li>
</ul>

現時点では、テキストが次の行にオーバーフローする場合、左端まで揃えられます (注文オプションの下の例)。リストの見出し (注文オプション) を左に揃え、次の行にオーバーフローした場合に注文オプションを説明するテキストを揃えるための最良の方法は何ですか?

注文オプション - これはテキストです
私は醜いオーバー フロー テキスト

注文オプション - これはテキストです
                私はテキストがかなりあふれています!

編集:

ここに私のcssがあります

ul.list_arrow, ul.list_arrow2 {
    margin: 0px 0 15px 15px!important;
}
ul.list_arrow li {
    padding: 2px 2px 2px 0px;
    list-style-image: url(../images/icon/arrow_a.gif);
}
ul.list_arrow2 li {
    padding: 2px 2px 2px 0px;
    list-style-image:url(../images/icon/arrow.png)
}

dl.list_arrow, dl.list_arrow2 {
    margin: 0px 0 15px 15px!important;
}
dl.list_arrow dt {
    padding: 2px 2px 2px 0px;
    list-style-image: url(../images/icon/arrow_a.gif);
}
dl.list_arrow2 dt {
    padding: 2px 2px 2px 0px;
    list-style-image:url(../images/icon/arrow.png)
}
4

2 に答える 2

2

次のようにスパンをインデントすることもできます (ここでフィドル):

li {
  padding-left:150px;
}

li span {
  margin-left: -150px;
}​

ただし、ぶら下げインデント ( fiddle )を設定することをお勧めします。

li {
  margin-left:150px;
  text-indent:-150px;
}
于 2012-04-24T17:24:16.017 に答える
1

定義リストの方がニーズに適しています。このjsFiddle の例を参照してください。

HTML

<dl class="list_arrow2">
    <dt>Signup Options </dt>
    <dd>–&amp;nbsp;&nbsp; Describe your signup options that an applicant can choose 
    from. List the signup option type, description, and price. For example, the 
    two signup options might be Customer or Distributor; each option would carry 
    a different description of cost and details</dd>
    <dt>Order Options </dt>
    <dd>–&amp;nbsp;&nbsp; Indicate any additional purchase options that an applicant 
    may have. This may be in the form of a single item or package item order. For 
    example, you might want to give the applicant a choice to purchase a &quot;starter 
    kit&quot; that includes various products that you sell. Be sure to list the details 
    of these items, including a description and price. </dd>
    <dt>Autoship Options </dt>
    <dd>–&amp;nbsp;&nbsp; This section can be exclusive of the Order Options section 
    or you can include both. The Autoship section is just like the Order Options 
    section except that the applicant is agreeing to receive the order on an monthly, 
    recurring basis. Be sure to include descriptions, pricing, etc. </dd>
    <dt>Payment Options </dt>
    <dd>–&amp;nbsp;&nbsp; List the types of credit cards you accept (Visa, M/C, AMEX, 
    Diners). Also, if you intend on taking personal checks online, or ACH, be sure 
    to add this to your details. If you plan on taking online checks, or ACH, please 
    contact your Account Manager for more details on getting this set up. </dd>
    <dt>Terms and Conditions</dt>
    <dd>–&amp;nbsp;&nbsp; Please provide the full text of your terms and conditions 
    and/or Distributor Agreement. This will be displayed for the applicant to agree 
    to before proceeding with their registration. </dd>
    <dt>Confirmation Message </dt>
    <dd>–&amp;nbsp;&nbsp; Please provide us with the text that is displayed once the 
    applicant successfully signs up. This text is also emailed to the new applicant.
    </dd>
    <dt>Welcome Message </dt>
    <dd>–&amp;nbsp;&nbsp; Please provide us with the text that is displayed as an introduction 
    to the applicant. </dd>
</dl>

</p>

于 2012-04-24T17:32:15.573 に答える