css常用 (手打记不住)

2021-10-14  本文已影响0人  JakeBless

/小程序里清除浮动/
<view style="float:left"></view>
<view style="clear:both; height: 0"></view>
或者父容器添加
.clear::after{display:block; height:0;clear:both; content: ''}

/浮动/
.fl{float: left}
.fr{float: right}
.clearfix:after{content:"";display:block;height:0;clear:both;visibility:hidden}
.clearfix{display:inline-block}

//超过裁剪
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;

// 裁字行数
word-break:break-all;
display:-webkit-box;
-webkit-line-clamp:2;
-webkit-box-orient:vertical;
overflow:hidden;

//换行
word-wrap:break-word;

//不换行
white-space:nowrap;

//自动
word-wrap: break-word;
word-break: normal;

// 黑白
-webkit-filter: grayscale(100%); /* Chrome, Safari, Opera */
filter: grayscale(100%);

// 移动端滚动
webkit-overflow-scrolling : touch;

// 画三角

.san {
  width: 0;
  height: 0;
  border-left: 50px solid transparent;  
  border-right: 50px solid transparent;
  border-bottom: 100px solid #ff0066;
}

// input placehoder
input::-webkit-input-placeholder {
color:rgba(153,153,153,1)!important;
}
input:-moz-placeholder{
color:rgba(153,153,153,1)!important;
}
input::-moz-placeholder{
color:rgba(153,153,153,1)!important;
}
input::-ms-input-placeholder{
color:rgba(153,153,153,1)!important;
}

上一篇 下一篇

猜你喜欢

热点阅读