My problem: My clock icons break off like this on some phone screens
How it should be: They should take the time value with them and break together like this:
Here’s the HTML:
https://jsfiddle.net/jfta78n3/
And just in case it could become relevant, because it makes it difficult to wrap something around just the time and the icon without also wrapping the rest of the date –
I’m generating the part in question like this with Vue 3:
{{
formatDate(
show.dateExport,
show.timeStart ? "long" : "short"
)
}}
<span v-if="show.timeStart">
<i class="bi-clock-fill" />
</span>
2
Answers
Wrap anything that shouldn’t break in a
<span>
and style it withwhite-space: nowrap
updated jsfiddle
Found a solution by wrapping the time with the span:
And adding the
text-nowrap
from bootstrap to thespan
.