html - How would I make a <div> automatically make a new line judged on the input? -


what mean is, possible make div when type stuff div, automatically makes new line each new line in code detects? example, want this:

<div>     hello, world!     how doing today? </div> 

which return

hello, world!
how doing today?

which in reality requires <br> or something. don't want have put millions of them make simple lines. code put before outputs this:

hello, world! how doing today?

i want automatic new line judged on code's enters. possible?

use css white-space property.

<div style="white-space:pre">     hello, world!     how doing today? </div> 

note preserve white space, including multiple spaces (such indent). if want collapse white space still use newline characters indicate line breaking, can use pre-line value, though option not supported in ie7 (if matters you).

see live example: http://jsfiddle.net/vyme6xs8/1/


Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -