0

so i have this divs that overflow when i type something repetitive like hahahahha or lalalal i was wondering if theres a solution for this problem? i know i can put overflow:hidden or auto; but id like to know if theres a solution :P

Thanks

3
Contributors
5
Replies
38
Views
3 Years
Discussion Span
Last Post by centenond
0

Provide a sample if the code you are working with.

What kind of solution are you looking for? How do you want it to behave when you type repetitive characters?

0

Provide a sample if the code you are working with.

What kind of solution are you looking for? How do you want it to behave when you type repetitive characters

you could try setting a max-height or min-height to your parent div.

<DIV STYLE="WIDTH:200PX;HEIGHT:AUTO;BORDER:1PX SOLID BLACK;MARGIN:20PX;">
    HAHAHAHHAHAHAHAHAHAHAHAHAHAHAHHAHAHAHAHAOVERFLOWS
</DIV>

<DIV STYLE="WIDTH:200PX;HEIGHT:AUTO;BORDER:1PX SOLID BLACK;MARGIN:20PX;">
    SAME DIV BUT TYPING WIDTH SPACES AND NORMAL DOESNT OVERFLOW
</DIV>

screenshot below, thanks

Edited by centenond

Attachments OVERFLOW_PROBLEM.png 7.76 KB
1

Ok, see with the example code and pictures, it makes it a lot easier to understand what you are asking, at least i think i understand.

What you are saying is that you would like the content in the first div to fit within the div element like in the second div example. If that is the case, just use the word-wrap property.

<DIV STYLE="WIDTH:200PX;HEIGHT:AUTO;BORDER:1PX SOLID BLACK;MARGIN:20PX;word-wrap:break-word;">
    HAHAHAHHAHAHAHAHAHAHAHAHAHAHAHHAHAHAHAHAOVERFLOWS
</DIV>
<DIV STYLE="WIDTH:200PX;HEIGHT:AUTO;BORDER:1PX SOLID BLACK;MARGIN:20PX;">
    SAME DIV BUT TYPING WIDTH SPACES AND NORMAL DOESNT OVERFLOW
</DIV>
0

Ok, see with the example code and pictures, it makes it a lot easier to understand what you are asking, at least i think i understand.

Thanks jorge that seems to work :) very much thanks

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.