A single-line label avoids awkward breaks but can run wider than its parent. Decide where overflow belongs before disabling wrapping.
Worked example
<style>
.demo {
white-space: nowrap;
}
</style>
<div class="demo">Keep text on one line</div>Implementation notes
If a label must stay on one line, inspect its minimum content width inside a flex or grid layout. The parent may be the element preventing a controlled truncation.
Try it yourself
Test the longest translation at a narrow viewport.
Open the CSS example →Editorial date December 13, 2025 · Published December 6, 2026