line breaks - Any HTML entity would remove space? -


due change line lead space between characters. i'm using wbr stop creating space between charaters, this:

<p><wbr ></wbr>这里有一段很长,<wbr ></wbr>很长的文字;这里<wbr ></wbr>有一段很长,很长<wbr ></wbr>的文字;这里有一<wbr ></wbr>段很长,很长的文<wbr ></wbr>字;</p> 

i wonder if there better solution? maybe... there html entity remove front space?

html entities used represent reserved characters angle brackets.

one objective of web development separate style structure presentation. that's why problem must solved javascript, not html.

to it, select element dom , use replace method. replace instances of whitespace following

var wbr = document.getelementsbytagname("wbr"); wbr.innerhtml = wbr.innerhtml.replace(/\s/g, ''); 

to replace leading , trailing whitespace this

wbr.innerhtml = wbr.innerhtml.trim(); 

Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -