Click to See Complete Forum and Search --> : CSS Preformated
CompGeek01
08-03-2004, 01:00 AM
Hey guys,
I'm trying to update my blog site and this time I don't really want to use HTML like it did before in all of my posts. How can I preformat my text into <div>'s? So far it's been nothing but frustrating because the <pre> (both HTML and CSS "white-space: pre" versions) override the div width!! Please help! It's late!
Crude Example: http://www.lifeofbrian.us/newsite/
fishybawb
08-03-2004, 11:14 AM
Unless I'm completely misunderstanding what you're trying to do, this might help:
http://glish.com/css/
CompGeek01
08-03-2004, 01:01 PM
Yes and no.
I'm trying to make a Blog....yes. I was tired last night so I'll give this another go.
My website is php/mysql run. Posts are stored in a table and then accessed when you visit the page. I have created an admin section of the site where you can edit the posts and the like. I've been doing this for a fair number of years actually. However, when I first created the blog "engine" all input via text boxes and text areas would come out unformatted. This is a problem because I don't want to be typing:
Hello<br/>
This is a post.<br/>
Post Content!!!
Rather, I'd like to type this:
Hello
This is a post.
Post Content!!!
I figure there are two ways to do this:
1) Insert line breaks when the data is inserted into the database.
-or-
2) Have the text be preformatted with a <pre> tag.
If there is any other way to do this.....please enlighten me. There must be something that I'm not thinking of. Do all forums and such insert line breaks and paragraphs when the user submits the data or at time of retrieval? Maybe I'm just confused and there is no way to do Option #2 because no sites that I have ever seen use preformatted text via CSS or HTML.
:t
CompGeek01
08-04-2004, 12:04 AM
Ok, answering my own thread:
$body = preg_replace( "/\n/" , "<br/>" , $body );
That works fine for what I'm doing. I suppose one more line of code won't kill me. I just tried to use the CODE vB tag and it does the same thing so I assume there is no way to break <pre> to a certain width. Is is...after all...... pre formatted like that, that would be against the whole purpose! :t
SysOpt.com
Copyright Internet.com Inc. All Rights Reserved.