Help - Search - Members - Calendar
Full Version: How to Display text at new line if the word is too long and dont have space in between it
HTMLHelp Forums > Web Authoring > Markup (HTML, XHTML, XML)
amitsukte
Hi all suppose i have text like this with no space in between each word then how can i display the same word in multiple lines without putting <br> tag manually. please help.


aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
Christian J
You might use the CSS3 "word-wrap" (AKA "overflow-wrap") property, see https://developer.mozilla.org/en-US/docs/Web/CSS/word-wrap

For older browsers you must insert some kind of hint where you want breaks to be possible, such as the WBR element. This can be a tricky subject, depending on the content you want to make breakable. See https://www.cs.tut.fi/~jkorpela/html/nobr.html#suggest
pandy
Doesn't soft hypen (&shy;) have pretty good support now?
Christian J
I don't know. unsure.gif But for newer browsers it seems easier to use "word-wrap" anyway.

BTW how do you stop the entity from being rendered? unsure.gif
pandy
Yes it does: (&amp;). biggrin.gif

Yeah, word-wrap is smoother, but if you want to catch the not so new but not so old either browsers soft hyphen may work. I think support was good some years ago already, but I may be wrong.
pandy
You edited your post! I answered what you originally wrote. As a punishment you'll have to figure it out yourself. tongue.gif
Christian J
QUOTE(pandy @ Apr 30 2014, 02:00 AM) *

You edited your post! I answered what you originally wrote.

Didn't see your reply...

QUOTE
As a punishment you'll have to figure it out yourself. tongue.gif

This is supposed to be a help forum, pandy. dry.gif

pandy
QUOTE(Christian J @ Apr 30 2014, 12:57 PM) *

Didn't see your reply...

It's just after the post you edited. You said it didn't work and I said Yes, it does.


CODE
This is supposed to be a help forum, pandy.  <_<


Things aren't always as you expect them to be. biggrin.gif
Christian J
QUOTE(pandy @ Apr 30 2014, 01:22 PM) *

It's just after the post you edited. You said it didn't work and I said Yes, it does.

I meant I didn't see your reply when I edited my post. Tried both

CODE
(&amp;)

and

CODE
&amp;amp;

to no avail.

QUOTE
Things aren't always as you expect them to be. biggrin.gif

So you want money. How much? unsure.gif

pandy
Give me an offer! cool.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2018 Invision Power Services, Inc.