text-overflow: ellipsis
Bootstrap 3 navbarのテキストで使用したい.navbar-brand
ので、iPhone のようなデバイスでは、navbar が垂直サイズで大きくなるのではなく、テキストが切り捨てられます。
私も2つのボタンを持っています:
<nav class="navbar navbar-default navbar-fixed-top">
<button type="button" class="btn btn-default navbar-btn navbar-left">Back</button>
<a class="navbar-brand" href="#" >Branding text that can sometimes be too wide</a>
<button type="button" class="btn btn-default navbar-btn navbar-right">Logout</button>
</nav>
の幅をハードコードする場合はtext-overflow: ellipsis
(withwhite-space: nowrap
およびset も) 動作しますが、最大の利用可能なスペースが自動的に使用されるように、これを達成する方法を探しています。overflow: hidden
.navbar-brand
PS
.navbar-brand
幅がハードコードされている場合に追加すると機能する CSS :
.ellipsis {
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}