我想从 TEXT 列中回显 mysql 数据,并保留中断。我曾经<pre>
这样做过,但这会忽略style="word-break:break-word;"
伪示例:
<?php echo '<pre>'; ?>
<div style="width: 100px; word-break:break-word">
LonglonglongLonglonglongLonglonglongLonglonglongLonglonglongLonglonglongLonglonglongLonglonglongLonglonglongLonglonglongLonglonglongLonglonglongLonglonglongLonglonglong
LonglonglongLonglonglongLonglonglongLonglonglongLonglonglongLonglonglongLonglonglongLonglonglongLonglonglongLonglonglongLonglonglong
</div>
<?php echo '</pre>'; ?>
(div里面的文字是从mysql里拉出来的)
break-word;
在此示例中将不起作用,因为文本是用<pre>
标签包裹的。如何保留原始文本的换行符,但在显示时诱导分词?