Wrap Predefined Text?
- Snubby
-
Snubby
- Member since: Dec. 4, 2004
- Offline.
-
- Forum Stats
- Member
- Level 21
- Game Developer
- DFox
-
DFox
- Member since: Aug. 9, 2003
- Offline.
-
- Forum Stats
- Member
- Level 30
- Blank Slate
Please elaborate.
Do you mean with PHP? If so you can use the PHP wordwrap function but really I'm just guessing based on the minimal details you provided...
- different
-
different
- Member since: Jul. 8, 2004
- Offline.
-
- Forum Stats
- Member
- Level 35
- Blank Slate
If you're talking about preformatted text, you can use the <pre>TEXT HERE</pre> tags in xhtml. This does rely on you to format the text yourself, so it won't wrap for you.
> twitter.
- Snubby
-
Snubby
- Member since: Dec. 4, 2004
- Offline.
-
- Forum Stats
- Member
- Level 21
- Game Developer
Sorry, I don't know much about PHP so I thought that was enough information. I'm talking about word wrapping stuff within a 'pre' tagg in html.
- Jessii
-
Jessii
- Member since: Feb. 10, 2005
- Offline.
-
- Forum Stats
- Member
- Level 36
- Movie Buff
At 11/13/06 07:32 AM, Snubby wrote: Sorry, I don't know much about PHP so I thought that was enough information. I'm talking about word wrapping stuff within a 'pre' tagg in html.
I don't really understand the point of the <pre> tag because it doesn't do anything but make things ugly. I would stick it in a div layer or you can put it in a table and make the table wrap. Otherwise, just don't use pre tags, they're not really necessary.
- different
-
different
- Member since: Jul. 8, 2004
- Offline.
-
- Forum Stats
- Member
- Level 35
- Blank Slate
At 11/13/06 07:40 AM, Jessii wrote: I don't really understand the point of the <pre> tag because it doesn't do anything but make things ugly. I would stick it in a div layer or you can put it in a table and make the table wrap. Otherwise, just don't use pre tags, they're not really necessary.
They're good for blocks of code - preserving whitespace, formatting it to look like code - see here:
> twitter.
- Jessii
-
Jessii
- Member since: Feb. 10, 2005
- Offline.
-
- Forum Stats
- Member
- Level 36
- Movie Buff
At 11/13/06 09:40 AM, different wrote: http://www.linksforflash.com/asmain/basic/asn ame.html
Yeah but that's all it's really good for. If that's what it's going to be used for, stick it in a div and it'll be ok. If you're going to be using proper line breaks like the example above, then the text won't fall off of the page.
- Claxor
-
Claxor
- Member since: Oct. 21, 2005
- Offline.
-
- Forum Stats
- Member
- Level 12
- Blank Slate
At 11/13/06 10:59 AM, Jessii wrote: Yeah but that's all it's really good for. If that's what it's going to be used for, stick it in a div and it'll be ok. If you're going to be using proper line breaks like the example above, then the text won't fall off of the page.
Well, there's a problem. If you have very long strings, like aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaa, they will fuck up your layout (though I think Newgrounds adds linebreaks anyway). The reason wordwrap isn't useful here is that it may cut straight though html-tags, fucking your text up even more :O
- Afro-Ninja
-
Afro-Ninja
- Member since: Mar. 2, 2002
- Offline.
-
- Send Private Message
- Browse All Posts (13,458)
- Block
-
- Forum Stats
- Moderator
- Level 44
- Game Developer
for my forum I check each word of each post for character length (excluding tags since those will be parsed smaller than the raw html) and if any of the words is over X characters long (the max characters a div can support without stretching) it throws an error
- Jessii
-
Jessii
- Member since: Feb. 10, 2005
- Offline.
-
- Forum Stats
- Member
- Level 36
- Movie Buff
At 11/13/06 11:15 AM, Claxor wrote: Well, there's a problem. If you have very long strings, like aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaa, they will fuck up your layout (though I think Newgrounds adds linebreaks anyway). The reason wordwrap isn't useful here is that it may cut straight though html-tags, fucking your text up even more :O
That's why I'm saying that you use the pre tags, you have to automatically add line breaks depending on how long the string is and then you can just put it back together.
- Snubby
-
Snubby
- Member since: Dec. 4, 2004
- Offline.
-
- Forum Stats
- Member
- Level 21
- Game Developer
The reason I am using pre tags is because I want to not let people hack me by just posting html taggs and open notes. It's for the Content Reviews on my website.
- Jessii
-
Jessii
- Member since: Feb. 10, 2005
- Offline.
-
- Forum Stats
- Member
- Level 36
- Movie Buff
At 11/13/06 04:13 PM, Snubby wrote: The reason I am using pre tags is because I want to not let people hack me by just posting html taggs and open notes. It's for the Content Reviews on my website.
Then use the htmlspecialchars() function...
Oh and Snubs, your site is too wide for my 800px resolution @ work :(
- Snubby
-
Snubby
- Member since: Dec. 4, 2004
- Offline.
-
- Forum Stats
- Member
- Level 21
- Game Developer




