html - Don't break words at whitespace with CSS -
i have div set width. way text broken default @ white space. there way set style of element, text broken @ given character fill out maximum space available?
thanks in advance!
the word-break property in css can used change when line breaks ought occur. normally, line breaks in text can occur in spaces, when there space or hyphen. using word-break: break-all
can override that.
as aside can useful stopping long urls breaking out of text containers.
div { width: 200px; background: pink; } p {word-break: break-all; }
<div> <p>lorem ipsum dolor sit amet, consectetur adipiscing elit. vestibulum venenatis, justo quis mollis volutpat, nibh enim. lorem ipsum dolor sit amet, consectetur adipiscing elit. vestibulum venenatis, justo quis mollis volutpat, nibh enim</p> </div>
jquery "alternative"
plugins including, not limited to, https://github.com/bramstein/hypher can employed , give nicer overall appearance using associated dictionaries (language dependent) hyphenate words when break.
Comments
Post a Comment