The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> something like word wrap
codin
post May 12 2012, 11:17 AM
Post #1





Group: Members
Posts: 6
Joined: 12-May 12
Member No.: 17,102



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..

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post May 12 2012, 01:01 PM
Post #2


WDG Member
********

Group: Root Admin
Posts: 8,025
Joined: 4-August 06
From: Mountain View, CA
Member No.: 3



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?


--------------------
Darin McGrew
WDG Member since 1998
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post May 12 2012, 01:06 PM
Post #3


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 15,632
Joined: 9-August 06
Member No.: 6



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


--------------------
"Never go to excess, but let moderation be your guide."
- Cicero

IPB Image
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Frederiek
post May 13 2012, 04:39 AM
Post #4


Programming Fanatic
********

Group: Members
Posts: 4,509
Joined: 23-August 06
From: Europe
Member No.: 9



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


--------------------
"The earth does not belong to us. We belong to the earth."
from Vue du ciel (in French)

"Leave scepticism to others and take action"
from HOME by Goodplanet

An inconvenient truth by Al Gore
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
codin
post May 13 2012, 01:37 PM
Post #5





Group: Members
Posts: 6
Joined: 12-May 12
Member No.: 17,102



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...
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post May 13 2012, 02:11 PM
Post #6


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 15,632
Joined: 9-August 06
Member No.: 6



Problem solved then. Never type gibberish! biggrin.gif


--------------------
"Never go to excess, but let moderation be your guide."
- Cicero

IPB Image
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 25th November 2014 - 06:00 PM