0
テンプレート文字列を使用してinfoDivのテキストを更新しようとしていますが、何らかの理由でこのテキストがすべて1行にあります。私は間違って何をしていますか? theseのソリューションは動作しません。レンダリングされたばかりです。文字列テンプレート - 新しい行が表示されない
infoDiv.textContent = `Hi!
It's a ${counter} question quiz.
It takes about ${time_minutes} minutes to solve it.
Are you ready?`
EDIT:
私は、CSSのソリューションhere(white-space: pre-line;
)を発見しました。
let counter = 8;
let time_minutes = 3;
infoDiv.textContent = `Hi!
It's a ${counter} question quiz.
It takes about ${time_minutes} minutes to solve it.
Are you ready?`
<div id="infoDiv" style="white-space: pre-line"></div>
あなたはあなたのコードを投稿してもらえますか? – Pavel
[テキストのみのdivに新しい行を挿入]の複製があります(http://stackoverflow.com/questions/37811366/insert-new-line-in-text-only-div) –
DIVはスペースのみを許可します。 –