I know that you can do a line break with zero-width characters and word-break
like this:
div {
display:inline-block;
font-size:30px;
width:100px;
border:1px solid black;
word-break:keep-all;
}
<div>今日は​晴れ​です</div>
As this is in the title, it doesn't require any additional elements, so it seems to meet the condition. However, in fact, keep-all
prevents the "今日は" part from being broken, which is a problem when there is additional text.
div {
display:inline-block;
font-size:30px;
width:100px;
border:1px solid black;
word-break:keep-all;
}
<div>今日はいい天気ですね。​晴れ​です</div>
I want to get this result in the text above:
div {
display:inline-block;
font-size:30px;
width:100px;
border:1px solid black;
}
<div>今日はいい天気ですね。<br>晴れ<br>です</div>
Question
I'd like to treat only the "晴れ" part as a lump, but is there a way to do this without the need for additional elements and without causing the above problem?