Reputation: 75
I have some block of text, and I put it between the <p>
tag. My problem is that the line is breaking badly (the word is cut in the middle). Check the screenhost:
Screen of bad breaking the word promoted
I want that word (promoted) on the new line. My code is:
<p>Share your server on social platforms to promote it.</p>
What's wrong with this?
Upvotes: 0
Views: 269
Reputation: 73
This is a HTML/CSS problem, nothing to do with PHP. You can use word-break: break-word
.
If above solution doesn't work for your case, some code snippet will help to debug it better.
Upvotes: 1
Reputation: 791
Adding a CSS class to the paragraph will break the word as you want it. Simply add a class, or make an inline CSS style of overflow-wrap: break-word;
p {
overflow-wrap: break-word;
}
<p>Share your server on social platforms to promote it.</p>
Upvotes: 0