In DIV I put paragraph but when text is longer then div,it does not make new line but out of the DIV.I try with: -moz-hyphens:auto; -ms-hyphens:auto; -webkit-hyphens:auto; hyphens:auto; word-wrap:break-word;
but it doesn't work.Any suggestions?
Here is code of div:
<div id="content">
<p id="test">tfufygigighfetefddddddddddddsssssssssssssssssssssssssssssssssssssssssssfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff</p>
</div>
css code of div:
#content {
float:left;
position:absolute;
background-color:#D4D3D0;
height:500px;
width:80%;
}
and the css of paragraph:
p.test {
-moz-hyphens:auto;
-ms-hyphens:auto;
-webkit-hyphens:auto;
hyphens:auto;
word-wrap:break-word;
}
I'm going out on a limb here! But I believe you need to put word-wrap: break-word;
in the div css, instead of the <p>
css. It works for me!
Edit:
Oh wait, I can see what you did wrong. The name of the <p>
tag isn't p.test
it's #test
!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With