Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Paragraph auto newline

Tags:

html

text

css

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;
}
like image 904
user188703 Avatar asked Oct 16 '13 17:10

user188703


1 Answers

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!

like image 64
Scott Rowell Avatar answered Oct 28 '22 15:10

Scott Rowell