所以我这里有一个带有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 "BALE" 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|
| | | |
| | | |
| |___________________| |
-------------------------------------------------------------
答案 0 :(得分:2)
只需add the style white-space: normal;
to the p
。
您已在父table
元素上设置了white-space: nowrap;
,并且p
继承了该元素。 white-space: normal
撤消那种风格。
答案 1 :(得分: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">