提问者:小点点

HTML中未显示的空格


我在MySQL数据库中存储了以下文本。

<p style='text-align: left;'><span style='font-size: 10px;'>Test</span><strong style='font-size: 10px;'><span style='color: red;'> red bold </span></strong><span style='font-size: 10px;'>text</span></p>

在页面中,它被读取并显示为

$htmlText = ... gets the above html from the database

<div id="text1" onclick="modalText(this)" style="border: 1px solid;">
    <?php echo $htmlText;?>
</div> 

我明白了:

当我点击div时,它会打开一个模态窗口,在这里可以使用tinyMCE编辑文本,在这里它的显示没有间距问题。

为什么我会遇到初始的sapcing问题,我该如何解决它?


共1个答案

匿名用户

若要在文本之前,之后或之间创建额外的空格,请使用 ; (非中断空格)扩展HTML字符。