Beautiful paragraphs with text-wrap:pretty

Beautiful paragraphs with text-wrap:pretty

Using text-wrap: pretty to beautify our paragraphs

Often while creating the layout we have to change the width of the container or padding of the container or width of the paragraph itself to ensure that it does not end with a single word.

here as you can see our paragraph ends with a single word

But we have a more efficient solution to this problem which is text-wrap: pretty which not only ensures that our paragraph does not end with a single word but also adjusts the previous lines to adjust the justification.

p{
  text-wrap: pretty
}

now our paragraph does not end with a single word and the justification of previous lines is also adjusted.