CSS 常用样式

110 阅读1分钟

省略号

white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
word-break: break-all;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;

阴影值

box-shadow: 0 3px 2px rgb(0 0 0 / 4%), 0 7px 5px rgb(0 0 0 / 2%), 0 13px 10px rgb(0 0 0 / 2%), 0 22px 17px rgb(0 0 0 / 2%) !important

渐变色文字

background: -webkit-linear-gradient(-70deg,#9867f0 0%,#ed4e50 100%);
-webkit-background-clip: text;
background-clip: text;
color: transparent;

图片黑白滤镜

fiflter: none;
filter: grayscale(1) invert(1);