天天看點

解決移動端overflow:scroll元素内部1px元素不顯示方法

問題:移動端解決1px問題慣用方法是利用scale的方法縮放達到絕對的1px效果,然而android手機浏覽器會有一個問題,就是overflow:scroll元素内部1px元素不顯示

解決方案:不使用scale方法實作,轉而使用漸變的思想來實作,不用多說貼代碼吧,懂的人自然懂 哈哈

.split-border{
	position: absolute;
	top: 0px;
	width: 100%;
	height: 1px; 
	background: -moz-linear-gradient(top, #eee, rgba(255, 255, 255, 0));  
	background: -webkit-gradient(linear, 0 0, 0 bottom, from(#eee), to(rgba(255, 255, 255, 0)));  
	background: -o-linear-gradient(top, #eee, rgba(255, 255, 255, 0)); 
	background: linear-gradient(to bottom, #eee, rgba(255, 255, 255, 0)); 
}