css3常用

  1. 内容最多显示3行:{overflow : hidden ;text-overflow: ellipsis; display: -webkit-box;-webkit-line-clamp : 3 ;-webkit-box-orient: vertical;}
  2. 文本溢出省略号:{width:30px;overflow: hidden;text-overflow:ellipsis;white-space: nowrap;}
  3. 谷歌默认输入框选择后改变样式:input:-webkit-autofill {-webkit-box-shadow: 0 0 0px 1000px white inset !important;}
  4. input在type="number"时去掉上下小箭头:input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance: none !important;margin: 0; }
  5. input点击时去掉黑色的背景:input,select{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color: transparent;}-webkit-appearance: none;
  6. 拨打电话:
<div class="tel">客服电话:<a href="tel:400-825-8989" mce_href="tel:400-825-8989">400-825-8989</a></div>
  1. 垂直居中:position:absolute;top:50%;display:block;left:50%;transform:translate(-50%,-50%);
  2. 清除浮动:.clearfix:after{content:’’;display:block;height:0;overflow:hidden;clear:both;}.clearfix{*zoom:1;}或者.clearfix:after{content:’’;display:table;clear:both;}.clearfix{*zoom:1;}
  3. 强制换行:word-break: break-all;word-wrap: break-word;
  4. 两端对齐:text-align:justify; text-justify:distribute-all-lines; text-align-last:justify;

猜你喜欢

转载自blog.csdn.net/m0_37630809/article/details/92085966