Skip to content

Instantly share code, notes, and snippets.

@bigshans
Last active January 8, 2022 08:27
Show Gist options
  • Save bigshans/d6e480820d7ca52e80a5370bef42d38b to your computer and use it in GitHub Desktop.
Save bigshans/d6e480820d7ca52e80a5370bef42d38b to your computer and use it in GitHub Desktop.
Some css trcicks code record.
/* 当文本内容长度超过容器最大宽度时,自动省略多余的文本。 */
/* When the text content length exceeds the maximum container width,
* the excess text is automatically omitted. */
.line-clamp(@line) {
display: -webkit-box;
-webkit-line-clamp: @line;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
overflow-wrap: break-word;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment