V
V
vasIvas2016-01-22 16:17:11
css
vasIvas, 2016-01-22 16:17:11

Why is string trim not working in chrome?

Why is this code not working and how to make it work in chrome? link to codepen

<div class="container">
  <ul class="list">
    <li class="item"><a href="#" class="text">some text</a></li>
    <li class="item"><a href="#" class="text">some text</a></li>
    <li class="item"><a href="#" class="text">some text</a></li>
  </ul>
</div>

.container {
  width: 100px;
}

.list {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item {
  display: inline-block;
}

.text {
  display: block;
}

in firefox
8f20a2d098db4a23a6a17f12d7add9f8.png
in chrome
4aade92137d740a896e184568bcbdaed.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Stalker_RED, 2016-01-22
@Stalker_RED

Because for some reason you made the links a block.
codepen.io/anon/pen/ZQrbLL

D
Dmitry Kuznetsov, 2016-01-22
@dima9595

What is the meaning of pruning?
I guess that the point is that you are trying to cut not the text itself (i.e. li element), but the block.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question