wrap/no-wrap?

Daiphron

New Member
Messages
25
Reaction score
0
Points
0
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?
 

cowctcat

New Member
Messages
401
Reaction score
0
Points
0
put <p> tags arround where you want it to be a paragraph when you enter in the text that should make it work
 
Last edited:

Daiphron

New Member
Messages
25
Reaction score
0
Points
0
Ok, I went into the database table and added the tags. Looks fine now, thanks. However, I am still wondering if it is possible to reflect carriage returns entered originally on the one hand, but have the text correctly wrap inside an element on the other hand after the text had been entered. Just out of curiosity.

Thanks
Daiph
 
Top