Printable Version of Topic

Click here to view this topic in its original format

HTMLHelp Forums _ Cascading Style Sheets _ something like word wrap

Posted by: codin May 12 2012, 11:17 AM

hello everyone... This is my first post here and I am a beginner in web design. being a newbie, I require some help.
It would be great if I could learn something from the experts...


consider a div element having properties of width and height of 300px with a black 1px border.

I inserted a single paragraph in the above div tag without line breaks or anything.
now as the width of the div box is 300 px, the text which put inside doesnt fit in the width of the box and the box expands width-wise to contain the text..

but, there is space height wise in the box, So I want the text to jump to the next line and fill it and jump to the other line and so on..without the box width increasing or without using the scroll or hidden property on the div element...

In short, I want to do something like notepad word wrap...but inside the div element box..


Posted by: Darin McGrew May 12 2012, 01:01 PM

I'm confused. Text content in HTML normally wraps to fit the width of the available area. Why isn't your text content wrapping normally?

Posted by: pandy May 12 2012, 01:06 PM

Maybe it isn't a paragraph but more of a long word, i.e. no spaces where the line can wrap.

Posted by: Frederiek May 13 2012, 04:39 AM

You might look into Hyphenator at http://code.google.com/p/hyphenator/ .

Posted by: codin May 13 2012, 01:37 PM

QUOTE(pandy @ May 12 2012, 01:06 PM) *

Maybe it isn't a paragraph but more of a long word, i.e. no spaces where the line can wrap.


yes you are true...
was just checking out examples... typed some gibbrish not minding to put some spaces in between...

Posted by: pandy May 13 2012, 02:11 PM

Problem solved then. Never type gibberish! biggrin.gif

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)