안녕하세요.
overflow-wrap 과 word-break 는 동의어라고 나와 있지만 옵션 값이 서로 다릅니다.
overflow-wrap 는 normal, break-word, anywhere 값을 줄 수 있습니다.
break-word와 anywhere는 거의 동일하게 박스 요소의 문자열이 넘어갈 경우 단어 단위로 잘라서 줄바꿈 해 줍니다. 다른 점은 width의 값을 min-content로 설정했을 때, anywhere는 min-content에 따라 단어를 구분하는 것만 다릅니다.
샘플 : https://codepen.io/maruara/pen/YzZwPGb
# HTML
<p class="word-a">They say the fishing is excellent at
Lake Chargoggagoggmanchauggagoggchaubunagungamaugg,
though I've never been there myself. (word-a)</p>
<p class="word-b">They say the fishing is excellent at
Lake Chargoggagoggmanchauggagoggchaubunagungamaugg,
though I've never been there myself. (word-b)</p># CSS
p {
width: min-content;
background: gold;
}
.word-a {
overflow-wrap: break-word;
}
.word-b {
overflow-wrap: anywhere;
}