K
K
kDallas12032016-12-27 02:39:03
Joomla
kDallas1203, 2016-12-27 02:39:03

How to limit the number of characters in a Joomla module title?

2ab646666db9415a9e92e31b1cada3f5.png
I need to limit the number of characters in the latest news and events output module so that it ends with "... " I was thinking about doing this with JS, but I'm not very familiar with it yet.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Evgeny Kumanin, 2016-12-27
@kDallas1203

text overflow

p.clip {
    white-space: nowrap; /* Запрещаем перенос строк */
    overflow: hidden; /* Обрезаем все, что не помещается в область */
    background: #fc0; /* Цвет фона */
    padding: 5px; /* Поля вокруг текста */
    text-overflow: ellipsis; /* Добавляем многоточие */
}

<p class="clip">Магнитное поле ничтожно гасит большой круг небесной сферы, 
  в таком случае эксцентриситеты и наклоны орбит возрастают.</p>

css_text-overflow.png

X
xmoonlight, 2016-12-27
@xmoonlight

https://github.com/josephschmitt/clamp.js

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question