I have the following problem. I built a simple blog where I enter my text on one page and when I hit "save" it is written to the database and can be displayed on another page. Here is the crucial snippet:
while($row = mysql_fetch_array ($r))
{
print "<div class=\"blog_entries\">
<div class=\"entry_title\">{$row['title']}</div>
<div class=\"entry_date\">posted: {$row['date_entered']}</div>
<div class=\"entry\">{$row['entry']}</div>
</div><hr />\n";
}
On the one hand, I would like the text in {$row['entry']} to include the paragraphs that I set with simple carriage returns that I placed when I entered the text. i tried using "white-space: pre;" in the css for this element but this resulted in the lines not breaking at all (except in the places where I originally entered the carriage returns) so that they extended over the border of the content area. On the other hand, when I don't use "white-space: pre;" the entire text appears inside the content area (as it should) but it's just one lumpy block without any paragraphs. Is there a way to display the paragraphs correctly and at the same time have the text wrap correctly inside the content area so that it doesn't extend over it's borders?
while($row = mysql_fetch_array ($r))
{
print "<div class=\"blog_entries\">
<div class=\"entry_title\">{$row['title']}</div>
<div class=\"entry_date\">posted: {$row['date_entered']}</div>
<div class=\"entry\">{$row['entry']}</div>
</div><hr />\n";
}
On the one hand, I would like the text in {$row['entry']} to include the paragraphs that I set with simple carriage returns that I placed when I entered the text. i tried using "white-space: pre;" in the css for this element but this resulted in the lines not breaking at all (except in the places where I originally entered the carriage returns) so that they extended over the border of the content area. On the other hand, when I don't use "white-space: pre;" the entire text appears inside the content area (as it should) but it's just one lumpy block without any paragraphs. Is there a way to display the paragraphs correctly and at the same time have the text wrap correctly inside the content area so that it doesn't extend over it's borders?