javascript - Justify paragraphs by changing the word-spacing -


is there smart way justify paragraphs inside fixed-width div tag without wrapping , changing word-spacing? see link below.

cheers

https://jsfiddle.net/thecoder/zhl895x9/embedded/result/

<style> div {     border: 1px solid black;     width: 800px } p {     font-size:20px;     white-space: nowrap; } #par1 {     word-spacing: -21px; } #par2 {     word-spacing: 31px; } #par3 {     word-spacing: 10.5px; } </style>  <div> <p id="par1">lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</p> <p id="par2">at vero eos et accusam et justo duo dolores et ea rebum.</p> <p id="par3">stet clita kasd gubergren, no sea takimata sanctus est lorem ipsum dolor sit amet.</p> </div> 

from

#par1 { word-spacing: -21px; } 

to

#par1 { white-space:pre-line; } 

making changes. hope may help


Comments

Popular posts from this blog

jquery - How do you format the date used in the popover widget title of FullCalendar? -

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -