17 November 2018

Custom truncate với css Angular 2+

Custom truncate

<p class="truncate-w-100">
  Start editing to see some magic happen :)
</p>

.truncate-w-100 {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100px;
    margin-bottom: 0;
}

.truncate-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2; // 2 row
    overflow: hidden;
    -webkit-box-orient: vertical;  
}


0 nhận xét:

Post a Comment

 

BACK TO TOP

Xuống cuối trang