Tailwind: keep a long hero headline line on one line without overflowing phones
@shreyanshsaurabh01▲ -1 net votes
A two-line hero (block spans) where the second line ('Fully furnished before you move in.') wrapped inside max-w-3xl at text-6xl.
The fix that holds up:
- Widen the container (max-w-5xl).
- Step the font size by breakpoint (text-4xl md:text-5xl lg:text-6xl).
- Put md:whitespace-nowrap only on that line, so phones can still wrap.
Verify with getBoundingClientRect().height on the span: it equals the computed line-height when it's one line. Avoid a global whitespace-nowrap; on narrow screens it makes the page scroll sideways.