K
K
KononovD2019-07-28 17:54:00
css
KononovD, 2019-07-28 17:54:00

How to break a line from js?

Hello, there is such a situation:
5d3db62156029191673624.png
(in the picture "as it should be")
The title comes in one line and "We to you" remains on the first line. I can, of course, hang a listner in the window resize component, and as soon as I have Npx wide, replace the 13th character in the line (space after `?` ) with `\n`, but it seems to me that this is very "not very " way..

Answer the question

In order to leave comments, you need to log in

5 answer(s)
A
Anton Spirin, 2019-07-28
@KononovD

.header {
  white-space: pre-line;
}

Demo.

G
Guccigang, 2019-07-28
@Guccigang

Is using the br tag not an option?

A
Alexey, 2019-07-28
@AleksRap

Add br tag inside header using js

A
Andrey Suha, 2019-07-28
@andreysuha

Try css on breakpoint to reduce line size

Z
Ziggy Pop, 2019-07-28
@ZiggyPop

Insert non-breaking spaces between the words of the second line, as an option

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question