0

所以我在这里有一个带有 p 标签的 div 和 p 标签内的文本。问题是,文本不尊重 p 标签。尽管我在 css 中放了中断词,但它不会中断。

comgtech.com/partners.php

HTML:

<table style="border:1px solid red;height:300px; display:inline-block; position:relative; overflow:hidden; white-space:nowrap; width:805px; margin-top:10px; margin-bottom:10px;">
        <tr>
            <td>
                <div class="box">
                    <a href="http://www.bayadcenter.com" target="_blank">
                        <img src="images/bayadcenter-logo.png" style="z-index:3; margin-top:5px; text-align:center;"/>
                    </a>
                    <p style="text-align:justify; width:260px; font-size:10px; color:#514f4d;word-wrap:break-word; height:200px;">
                    <!--p style="margin-left:5px; margin-right:5px; z-index:3; text-align:justify;font-size:10px;" -->
                        <span style="font-size:12px;font-weight:bold;">Herradura Resources Corporation</span><br />
                        Herradura Resources Corporation (HRC) was established with the primary purpose of developing a LOAD ADVANCE facility with the objective to provide a more convenient, secure, and cost-efficient way of granting benefits to employees and agents. <br /> <br />
                        The Load Advance or &#34;BALE&#34; system aims to add variation to the existing benefits being offered to employees by providing them Value Added Services (VAS) particularly airtime load transfer services. This solution is considered to be the first and only BALE-VAS in the Philippines.
                    </p>
                </div>
            </td>
        </tr>
    </table>

CSS:

.box {
border:1px solid #cccccc;
width:260px;
height:290px;
padding-bottom:0.5em;
overflow:hidden; 
z-index:2;

    -moz-box-shadow 3px 5px 4px rgba(235, 235, 235, 1);
    -webkit-box-shadow: 3px 5px 4px rgba(235, 235, 235, 1);
    box-shadow: 3px 5px 4px rgba(235, 235, 235, 1);


    /* For IE 8 */
    -ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#060606')";
    /* For IE 5.5 - 7 */
    filter: progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#060606');

}

在 IE 中运行良好。

编辑:它看起来像这样:

--table------------------------------------------------------
|                                                           |
|  __<p>______________                                      |
| |                   |                                     |
| | texttexttextextextextextextextextextextextextextextextex|
| |                   |                                     |
| |                   |                                     |
| |___________________|                                     |
-------------------------------------------------------------
4

2 回答 2

2

只需将样式添加white-space: normal;p.

您已经设置white-space: nowrap;了父table元素,并且p继承了该元素。white-space: normal撤消这种风格。

于 2013-07-30T02:53:20.200 回答
0

你只需要使用这个:

word-break:normal;

把它放在你的嘴里<p>,话会断的。例如:

<p style="text-align:justify; width:260px; font-size:10px; color:#514f4d;word-wrap:break-word; height:200px;word-break:normal">
于 2013-07-30T02:59:31.087 回答