文本css

.ellipsis(@w: auto) {
  width: @w;
  overflow: hidden;
  text-overflow: ellipsis;//溢出部分用...代替  ,clip超出的部分会被裁剪掉
  white-space: nowrap;//文本不会换行 ,pre相似pre标签,会保留原来文本的空格和换行符
  word-wrap: normal;//只在容许的断字点换行 ,break-word能够在长单词或者url中换行
}

.ellipsisLn(@line) {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: @line;//行数
}

.text_wrap() {
  word-wrap: break-word;
  word-break: break-all;//容许在单词内换行
}

.hyphens() {
  word-wrap: break-word;
  -webkit-hyphens: auto;
  hyphens: auto;
}
//这个属性只用于iOS (iPhone和iPad)。当你点击一个连接或者经过Javascript定义的可点击元素的时候,它就会出现一个半透明的灰色背景
.setTapColor(@c: rgba(0, 0, 0, 0)) {
  -webkit-tap-highlight-color: @c;
}
.noselect {
  -webkit-user-select: none;//不能选中
  -moz-user-select: none;
  -ms-user-select: none;
  -o-user-select: none;
  user-select: none;
}
相关文章
相关标签/搜索