I have the following text stored in a MySQL database.
<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>
In a page it is read and displayed as
$htmlText = ... gets the above html from the database
<div id="text1" onclick="modalText(this)" style="border: 1px solid;">
<?php echo $htmlText;?>
</div>
and I get this:
When I click on the div it opens a modal window where the text can be edited using tinyMCE and here it displays without the spacing issue.
Why do I get the initial spacing problem and how can I work around it?