-
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?
-
Why would you need to have line limits? What is the text being contained in?
-
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.
-
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.
-
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...
-
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?
-
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.
-
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...