tehX
tehX

Reputation: 167

How to avoid overflow?(put overflow on a new line)

I want to stop a div from overflowing. Currently it's overflowing to the right when there's no <br>'s until the div ends.

I don't want to create any scrollbars. Just want to break the line when it reaches the end of the div. the CSS Div

#blog
{
border:#FFFFFF solid;
color:#FFFFFF;
width:760px;
min-height:100px;
border-color:#FFF;
border-width:thin;
float:left;
display: inline;
position:static;
z-index:1;
font-family: 'Quattrocento', serif;
background:#454545;
overflow:inherit;
}

I have messed around with the overflow property for some time now and i don't know what to enter into it to do what i want(or is it even possible)

Upvotes: 0

Views: 119

Answers (2)

bonflash
bonflash

Reputation: 724

Depending on the content, these options are applicable:

  • white-space: preline or normal. Actually, normal is the default one, it makes all extra spaces disappear and continue a text from a new line, when it meets the current line end. The lines are broken between words. Works nearly everywhere.
  • word-wrap: break-word - this time, long words will be broken, if they don't fit into a line. Works nearly everywhere (and in Opera 10.5 and higher=) )

Upvotes: 0

Joe
Joe

Reputation: 8262

I think

word-wrap:break-word;

Is what you need

DEMO

Upvotes: 2

Related Questions