Is it possible to use text-overflow: ellipsis on a button element?

Due to limitations in browsers, wrap the button text inside e.g. a span element and set the styles on it. Example (available as jsfiddle too):

<style>
.buttontext {
  width: 95px;
  overflow: hidden;
  white-space: nowrap;
  display: block;
  text-overflow: ellipsis;
}​
</style>
<button><span class=buttontext>Very long text Very long text
Very long text</span></button>

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)