Eunit99 / css-flexbox-text-ellipsis

CSS Flexbox Text Ellipsis

Home Page:https://css-flexbox-text-ellipsis.dinhquangtrung.net/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CSS Flexbox Text Ellipsis

Use: min-width: 0, text-overflow: ellipsis and white-space: nowrap.

HTML

  <div class="target">
    <div class="target-title">
      Text here is very very long that it might
      get truncate if this box get resized too small
    </div>
    <div class="target-button">
      Button
    </div>
  </div>

CSS

  .target {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
  }

  .target-title {
    overflow: hidden;
    padding: 5px;
    min-width: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .target-button {
    padding: 5px 10px;
    background: #2196F3;
    color: white;
  }

About

CSS Flexbox Text Ellipsis

https://css-flexbox-text-ellipsis.dinhquangtrung.net/


Languages

Language:HTML 51.1%Language:CSS 48.9%