css遇到的一些小问题
1:多行文本溢出
-webkit-line-clamp: 4;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
如若无效 改成
/* autoprefixer: off */
-webkit-box-orient: vertical;
/* autoprefixer: on */
2.滚动条隐藏
***注意***
设置-webkit-scrollbar ios滑动的时候 还是有滚动条
完美解决的方法 移动端设置padding-bottom:10px;margin-bottom:-10px;
3.按压:active ios不生效解决方法
<body ontouchstart="" onmouseover=""></body>
4.去掉input默认样式
background-color: transparent;
-webkit-appearance: none;
-webkit-tap-highlight-color: rgba(0,0,0,0);//去掉按压 点击 背景色
border: 0;
outline: none;
5.ios点击页面高亮问题
html{ -webkit-tap-highlight-color: rgba(0, 0, 0, 0); }
6.overflow:hidden/auto/scroll
盒子有position:fixed,其父盒子及祖盒子不可有overflow,不然会出现2个问题:1,页面值显示100%高度,其余被裁掉;2,微信上拉fixed定位盒子随着上拉底部出现空白;
解决方法:fixed盒子其兄弟盒子设置overflow(若需要滚动),设置overflow后,内部盒子设置最小高度,不然超出部分有时会被裁掉;
7.line-height:1的情况下,设置overflow,部分手机上文字会被裁掉部分
解决方法:padding-top:2px;margin-top:-2px;
8.iocn图标或bar要与标题文字一行居中对齐的时候(文字不只一行),用display:flex或position时,部分机上回出现垂直不居中对齐的问题
解决方法:使用display:inline-block;position:relative;top:2px;