Is it what you are looking for?
<ul class='navbar-nav'>
<li class='nav-item'>
<a href='#'>long textt...........</a>
</li>
</ul>
.nav-item {
width: 50px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
https://jsfiddle.net/7wc3L8bh/ - real example
If it is, than you should use Bootstrap 4 class text-truncate
See its documentation here (Note, that it requres block
element)
If it is not, and you want your text to be visible on the next line - use class text-nowrap
.
See its documentation here (Note, element should have fixed width
)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…