Ask Your Question
1

In CSS, what is the method to wrap the content of a div when a paragraph spans across two lines?

asked 2021-11-14 11:00:00 +0000

devzero gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-08-31 10:00:00 +0000

pufferfish gravatar image

The method to wrap the content of a div when a paragraph spans across two lines is to use the CSS property called "word-wrap" with the value of "break-word". This will allow the text to break at any point within a word in order to fit within the width of the containing div.

For example:

div {
  width: 200px;
  word-wrap: break-word;
}
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2021-11-14 11:00:00 +0000

Seen: 11 times

Last updated: Aug 31 '22