As you might heard in the title I’m using PHP to add info to a database and then use the info. It’s a simple comment system. I’m very new to PHP and don’t really know if there might be any easier way of creating what I’m doing but my problem is still the same. When I get info that is to big for the div to handle in one row if it got no spaces what so ever, it automatically increases the width and height of the div.
At the same time I’m having another div that contains the personal info like name and stuff. It is 1/4 of the width and the comment-div id 3/4 (as I’ve set it with CSS). The info-div gets smaller as the comment is getting bigger (for some insane reason, both in width and height!).
When I get the info I get all info from one column and displaying them in a table. I place the comment and the info-info in two separate td tags and each cell info in a div with the appropriate width and height (height 150px width 25%/75%).
I’ve already tried to break the line with word-wrap white-space and overflow but nothing seams to work.
I got some idea myself of how it comes the browser shows it like this, since the width and the padding of the divs seam to be matching with the values in the CSS if I’d have placed the info in the body and not in the content div. Why it would react like that I have no idea and I want to know if anyone knows what I can do about it… And as said, this only happens when a string is to long. Otherwise it’s working 100% fine.
Thankful for any help… and I use PHP, JS, HTML, CSS for the moment and a solution needs to be with ether of the formats (I could use like jQuery as well and other lookalikes)
maybe you could use
css
this means that your div never goes bigger that 300px and if the content is longer you will get an scrollbar.