Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

css text wrapping 1

Status
Not open for further replies.
Jul 28, 2005
358
FR
Hi,

I have some text that is pulled out of a datbase and formatted using css. The text has line breaks in it but they don't actually have <br> tags to control them eg.

Code:
This is a large light studio apartment on the first floor set back from a quiet street, with a generous balcony. It is well situated directly behind the Hotel Martinez, and is a block from the famous Croisette and beaches of Cannes

The apartment is only two minutes walk to the Rue D' Antibes, Cannes' main shopping street, and 8 minutes walk to the Palais des Festivals, the Old Port and the delightful Old City, (known as Le Suquet) with it's restaurants and nightlife.

The text above is exactly how it is stored.

Anyway, when I display the text, it comes out as one continuous line. I have tried to use the whit-space:pre css tag to break it up, and while it does it now displays each paragraph as a single line of text thus spilling out of the text area I have set it up with using width.

Can anyone help?

Richard
 
If you just have plain text, and it is not wrapping to its container, then there must be some other reason. For example, delivering &nbsp; instead of regular spaces... or some other CSS.

Check the former point, and if not relevant, you'd have to post your HTML and CSS code.

Hope this helps,
Dan


[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Just replace the line breaks in your text with <br> tags before you insert it into the page. Tell us what server-side language you're using and we can tell you how it's done.

Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
Strange, OPera renders it fine, but IE6 and Firefox don't.

Is there any reason for this?
 
Many thanks, Worked a treat.

Never used that before, but I get the feeling I will quite often now.

Richard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top