Text-overflow: многоточие для div с тегами HTMLCSS

Разбираемся в CSS
Ответить
Anonymous
 Text-overflow: многоточие для div с тегами HTML

Сообщение Anonymous »

У меня есть блок div, который будет содержать несколько HTML-тегов, абзацы и списки. Примеры:

Код: Выделить всё

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.
Lorem Ipsum is simply dummy text of the printing and typesetting industry.
[list]
[*]Some text #1
[*]Some text #2
[*]Some text #3
[/list]
Lorem Ipsum is simply dummy text of the printing and typesetting industry.

Я хочу, чтобы к содержимому div применялось text-overflow: ellipsis, если оно выходит за пределы размера div. Итак, что я попробовал:

Код: Выделить всё

.article-block {
width: 92mm;
height: 85mm;
margin-top: 2mm;
overflow: hidden;
text-overflow: ellipsis;
}
Результат будет выглядеть следующим образом:
Изображение

Я ожидал, что это будет выглядеть так, в конце будет "...":
Изображение

Могу ли я получить несколько советов о том, как этого добиться? Спасибо!
К вашему сведению: только CSS или HTML, никакого JS.

Подробнее здесь: https://stackoverflow.com/questions/783 ... -html-tags
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «CSS»