|
-
Jun 2nd, 2004, 05:00 AM
#1
Thread Starter
Fanatic Member
Chatbox
I've been trying to write a chatbox lately, but I can't make it work the way I want. I havn't found a good way to limit the line-length of the posts. Right now I just insert a <br /> every 20 characters, but it doesn't work very well. Any other ideas?
Never argue with fools, they will only drag you down to their level, and beat you with experience.
Q: How do you tell an experienced hacker from a novice?
A: The latter thinks there's 1000 bytes in a kilobyte, while the former is sure there's 1024 meters in a kilometer
-
Jun 3rd, 2004, 12:39 PM
#2
Stuck in the 80s
Why would you need to have line limits? What is the text being contained in?
-
Jun 4th, 2004, 07:25 AM
#3
Thread Starter
Fanatic Member
The text will be contained in a div. I need the limit so that even if someone writes a reeealllly long word it won't stretch the div.
Never argue with fools, they will only drag you down to their level, and beat you with experience.
Q: How do you tell an experienced hacker from a novice?
A: The latter thinks there's 1000 bytes in a kilobyte, while the former is sure there's 1024 meters in a kilometer
-
Jun 7th, 2004, 01:14 AM
#4
Junior Member
Set the div to a fixed width?
Doesn't have to be pixels, can be percentage as well, but as far as I know the DIV will word-wrap automatically if the width has been set.
If there is a way to solve your problems, there is no need to worry; if there is no way to solve your problems, there is no point to worry.
-
Jun 9th, 2004, 04:25 AM
#5
Thread Starter
Fanatic Member
Strange as it may sound, but the text will go outside of the div if the div is fixed size and the text won't fit on one line. Check out tobbesweden.1go.dk The post at the top will show you what I mean...
Never argue with fools, they will only drag you down to their level, and beat you with experience.
Q: How do you tell an experienced hacker from a novice?
A: The latter thinks there's 1000 bytes in a kilobyte, while the former is sure there's 1024 meters in a kilometer
-
Jun 10th, 2004, 01:11 AM
#6
Junior Member
In my browser at work (MSIE 6.0, Windows 2000) the DIV actually expands so that the entire line with all the w's on it will fit inside, but I see your point.
That is extremely odd actually. I assume overflow: auto; is an insatisfactory solution to the problem?
Maybe you could try and set a width to the element containing the text, since I assume there's a paragraph or another div that contains the actual chatbox entry?
If there is a way to solve your problems, there is no need to worry; if there is no way to solve your problems, there is no point to worry.
-
Jun 10th, 2004, 02:50 AM
#7
Thread Starter
Fanatic Member
Hej,
I use Opera 7.5 (WinXP) and here the text goes out of the div. I will try to have a separate <p></p>for every message and see how that works out.
Never argue with fools, they will only drag you down to their level, and beat you with experience.
Q: How do you tell an experienced hacker from a novice?
A: The latter thinks there's 1000 bytes in a kilobyte, while the former is sure there's 1024 meters in a kilometer
-
Jun 25th, 2004, 07:49 PM
#8
Junior Member
well, when i made mine i contained a div inside of a div, like so:
Code:
<div style="width: 100px; height: 300px">
<div style="width: 100px; height: 300px; overflow: auto">
--- php here ---
</div></div>
and it works just fine. sometimes though, if there is a broken link inside the posts it'll mess up like you said. i don't know why.
EDIT:
OR you could put the posts into a table inside of a div, with the border set to 0 so its invisible...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|