Похожие чаты

How can I detect if text overflows parent? Hi, everyone

3 ответов

7 просмотров

In plain css: there are just ways to cope with it. Like overflow hidden, or text overflow ellipsis. But in js you can measure width of text and width of parent and substract them.. if that helps

I dealt with that recently, really hard to do in JavaScript, but it's possible.

Maybe useful: write that text in canvas then measureText() https://www.w3schools.com/tags/canvas_measuretext.asp

Похожие вопросы

Обсуждают сегодня

Карта сайта