We are required to write a function breakString () that takes in two arguments first the string to be broken and second is a number that represents the threshold count of characters after reaching which we have to repeatedly add line breaks in place of spaces. The only way you "see" a line break is by observing a format change in the content. You can give the container a width and use the CSS3 word-wrap property. I've been doing modifications on a site and adding text via the ::after or ::before pseudo-elements and have found that escape Unicode should be used for things such as a space before or after the added content. As you are saying that the page uses jQuery, the following should handle the issue, when inserted into the initialization code to be executed upon page load: Here I am naively assuming that the elements involved are a elements nested inside an element in class product-name, as in the example. worked. This way you can just use media queries to let it brake whenever you want. See "Strings" and "Characters and case" for more information on the "\A" escape sequence. How to use css-property in html string in Flutter? Found this question here that seems to ask the same thing: Newline character sequence in CSS 'content' property? 3. In this next example, you can see what happens if overflow is set to hidden. I have a giant CSS file that has no carriage returns. Posted August 3, 2011. This example uses three classes, one for each possible configuration of the hyphens property. Typically used for short lines, such as in newspapers. How to do a linebreak always after one of a couple chars when a certain length would be exceeded? Break text using the least restrictive line break rule. Check out this demo Codepen: https://codepen.io/Marko36/pen/RBweYY, Reply to this topic. 0.4em = 1 ch. Unfortunately, there is currently no way in CSS to tune line breaking rules by specifying, for example, that a line break is permitted after a certain character wherever it appears in the text. How do I style a