Wrapping a paragraph inside a div?
How do I make my paragraph wrap inside my div? It is currently overflowing outside of the div and I have no idea how to stop the paragraph from overflowing over the edge. I do not want a scroll bar with:
overflow: scroll;
and the other overflow options don't seem to help here either... I have the following code:
div {
width: 1200px;
margin: 0 auto;
}
.container {
overflow: hidden;
}
.content {
width: 1000px;
float: left;
margin-left: 0;
text-align: left;
}
.rightpanel {
width: 190px;
float: right;
margin-right: 0;
}
<div class="container">
<div class="content">
<p>Some content flow开发者_如何学运维ing over more than one line</p>
</div>
<div class="rightpanel">
<!-- content -->
</div>
</div>
Edit:
<div class="container">
<div class="content">
<div class="leftcontent">
</div>
<div class="newsfeed">
<div class="newsitem">
<p>Full age sex set feel her told. Tastes giving in passed direct me valley as supply. End great stood boy noisy often way taken short. Rent the size our more door. Years no place abode in no child my. Man pianoforte too solicitude friendship devonshire ten ask. Course sooner its silent but formal she led. Extensive he assurance extremity at breakfast. Dear sure ye sold fine sell on. Projection at up connection literature insensible motionless projecting.<br><br>Be at miss or each good play home they. It leave taste mr in it fancy. She son lose does fond bred gave lady get. Sir her company conduct expense bed any. Sister depend change off piqued one. Contented continued any happiness instantly objection yet her allowance. Use correct day new brought tedious. By come this been in. Kept easy or sons my it done.</p>
</div>
</div>
</div>
<div class="rightpanel">
</div>
I see now! You are giving all divs a width of 1200px. If you take that away, everything will look fine. .newsfeed and .newsitem are taking on this attribute.
You could alternatively give .newsfeed and .newsitem a width:
.newsfeed , .newsitem { width: 300px; }
example: http://jsfiddle.net/UZMR2/
精彩评论