lightalex
@lightalex

Можно ли в css свойстве content задать перенос?

Можно ли в css свойстве content задать перенос?
Ни <br>, ни \n не работает
Есть идеи?
  • Вопрос задан
  • 194 просмотра
Решения вопроса 1
madmaker
@madmaker
Full stack программист
Можно.
\A

Вот нашел:
www.w3.org/TR/CSS2/generate.html#x18

Authors may include newlines in the generated content by writing the "\A" escape sequence in one of the strings after the 'content' property. This inserted line break is still subject to the 'white-space' property. See "Strings" and "Characters and case" for more information on the "\A" escape sequence.


h1:before {
    display: block;
    text-align: center;
    white-space: pre;
    content: "chapter\A hoofdstuk\A chapitre"
}
Ответ написан
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы