LunarMagic Posted June 26, 2003 Posted June 26, 2003 Hiya, I'm searching all over the web trying to find a tag that's similar to PRE, as in, it preserves all line breaks as you type them, but still wraps and displays in a variable-width font (shouldn't affect anything other than line breaks). Even if there's not a tag to do that, does anyone know any css that would handle that for me? Anything? ARgh, I don't want to have to go re-write all these pages! Quote
TCH-Andy Posted June 26, 2003 Posted June 26, 2003 LunarMagic, It may just be me - it's getting towards the end of the day over here, but I'm not sure what effect you are after, have you got an example on your site of what is not working? and can you provide an example of what you want to do? Andy Quote
LunarMagic Posted June 26, 2003 Author Posted June 26, 2003 Yes, sure thing. =) Basically, like this forum... you type in this message like this. you don't add in any BR or P tags to your text here. When it posts, it posts with the paragraph spacing exactly as you type it in. This is on one line. This is on another. I have a form on my site (can't show you, it's part of a script for members, log in only, etc). And when they type in their information, it displays like this: When it posts, it posts with the paragraph spacing exactly as you type it in.This is on one line.This is on another. Soooo, I need some sort of "parser" or script that will take a text field such as this, and make sure it displays with the line breaks intact... Quote
borfast Posted June 26, 2003 Posted June 26, 2003 If you're into PHP, take a look at these two functions and experiment with them: nl2br -- Inserts HTML line breaks before all newlines in a string htmlentities -- Convert all applicable characters to HTML entities (turns stuff like 'á' into 'á' ) Quote
LunarMagic Posted June 26, 2003 Author Posted June 26, 2003 Oh yes, that worked perfectly! Thanks so much! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.