CSS 常用却记不住

188 阅读1分钟
  • flex居中
.parent {     
display: flex;     
justify-content: center;     
align-items: center; 
}
  • 手指
a {
cursor: pointer;
}
  • 文本超出省略号
/* 单行 */
.text {
overflow: hidden; 
text-overflow:ellipsis; 
white-space: nowrap;
}
/* 多行 */
.text {
display: -webkit-box; 
-webkit-box-orient: vertical; 
-webkit-line-clamp: 3; 
overflow: hidden;
}