D
D
Denis Bukreev2015-11-04 22:52:26
css
Denis Bukreev, 2015-11-04 22:52:26

How to hide text horizontally in header?

Let's say we have this code:

<div style="width:200px">
   <h3>Очень-очень длинный текст, такой длинный, что длинный</h3>
</div>

all the text does not fit into the div, I just need to hide it outside the div, but no matter what I do, it is transferred to the second line

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
archelon, 2015-11-04
@denisbookreev

htmlbook.ru/css/text-overflow
for example:

h3 {
 text-overflow: ellipsis;
}

I
Idel Gizatullin, 2015-11-04
@idelg

h3 {
  white-space: nowrap; /* Запрещаем перенос строк */
  overflow: hidden; /* Обрезаем все, что не помещается в область */
  text-overflow: ellipsis; /* Добавляем многоточие */
}

Example

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question