Question:
how to break a line in HTML?
kadarkarai
2009-12-22 04:30:39 UTC
Hi

i want to break a line when it reach the fixed with div IMPORTANT no spaces in the text


ex:

abcdefghijklmnopqurst


if the width of the div is 10px means after reach the next charter starts from next line


any idea plz

Thanks in advances.
Five answers:
?
2009-12-29 06:21:40 UTC
Depending on the exact effect you want you could use either the shy hyphen or thin space entities or as someone else suggested a zero width space.



If you use a zero width space the shortest markup is to use a single letter tag such as b and give it a style. To avoid having all text marked b disappear, set it up as in the example below so that it only applies inside your narrow divs.







Use of Shy entity







Narrow divs - no joiners



abcdefghijklmnopqurst


abcdefghijklmnopqurst


Narrow divs - ­ as joiner



a­b­c­d­e­

f­g­h­i­j­k­

l­m­n­o­p­q­

u­r­s­t


a­b­c­d­e­

f­g­h­i­j­k­

l­m­n­o­p­q­

u­r­s­t


Narrow divs -   as joiner



a b c 

d e f g 

h i j k 

l m n o 

p q u r 

s t


a b c 

d e f g 

h i j k 

l m n o 

p q u r 

s t


Narrow divs - zero size bold space as joiner



a b c d e f g h i j k l m n o p q u r s t


a b c d e f g h i j k l m n o p q u r s t








Note: Line breaks added to the divs so that all the text displays in Yahoo! Answers.

If copying this example remove the line breaks from the divs.
Sven
2009-12-22 04:47:28 UTC

IS NOT what you are looking for!

I don't think that it is possible to get a div container to break a unseperated string of text by its own.

you could try an put a whitespace behind each character and format them to width 0.

so css has possible breakpoints and with a width of 0 the user shouldn't see a difference to the unseperated string.
?
2009-12-22 04:48:00 UTC
i have 2 solution



1)



abcdefghijklmnopqurst





2) this -> rather difficult and not recomendded



abcd


efghi


jklmn


opqur


st

Ramesh Kumar
2009-12-22 04:41:05 UTC
Hello kadarkar

hay try the
tag , it is generally used to break the text in html programs.
Zia ur Rahman
2009-12-22 04:39:47 UTC
use
tag to break a line


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...