##點擊鏈接就可以撥打電話,怎么辦?
< a href="tel:13666655546">咪咕閱讀客服電話< /a >
##點擊鏈接就可以發送短信,怎么辦?
< a href="sms:13666655546">咪咕閱讀客服短信< /a >
##H5頁面的數字不想識別為電話號碼,怎么辦?
< meta name="format-detection"content="telephone=no" />
##H5頁面想忽略Android平臺中對郵箱地址的識別,怎么辦?
< meta name="format-detection" content="email=no"/>
##不想顯示webkit的滾動條,怎么辦?
element::-webkit-scrollbar{ display: none;}
##H5頁面的內容想不被人選中,怎么辦?
-webkit-user-select: none;user-select: none;
##H5頁面想禁止長按鏈接或長按圖片后彈出菜單,怎么辦?
-webkit-touch-callout: none;
##想取消IOS里Button、Input上的默認樣式,怎么辦?
-webkit-appearance: none;
##想在Android里H5頁面touch時沒有藍色的邊框與遮罩,怎么辦?
-webkit-tap-highlight-color:rgba(0,0,0,0);
##多張圖片放置在一起,不想有4PX的空隙,怎么辦?
img{display:block};
img{float:left};
img{vertical-align:top}
##想改變Input里 placeholder屬性的樣式,怎么辦?
::-webkit-input-placeholder{color:#ccc}
##H5頁面input type=”num”時想去掉右邊的上下箭頭,怎么辦?
input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance:none !important; margin: 0;}
##H5頁面加載的圖片太大了,怎么辦?
JPG圖片用JPEGmini壓縮,PNG可在線用http://tinypng.org/壓縮
##在iOS系統中鍵盤輸入時不想首字母為大寫,怎么辦?
<input type="text" autocapitalize="off" />
##在IOS系統中鍵盤輸入關閉自動修正,怎么辦?
<input type="text" autocorrect="off" />
##屏幕旋轉橫屏豎屏切換時,想禁止文本縮放,怎么辦?
-webkit-text-size-adjust: 100%;
##H5頁面想有快速回彈滾動的效果,怎么辦?
overflow: auto; /* auto | scroll */
-webkit-overflow-scrolling: touch;
##屏幕旋轉橫屏豎屏切換時想支持有不同的事件,怎么辦?
事件
window.orientation,取值:正負90表示橫屏模式、0和180表現為豎屏模式;
window.onorientationchange = function(){
switch(window.orientation){
case -90:
case 90:
alert("橫屏:" + window.orientation);
case 0:
case 180:
alert("豎屏:" + window.orientation);
break;
}
}
樣式
//豎屏時使用的樣式
@media all and (orientation:portrait) {
.css{}
}
//橫屏時使用的樣式
@media all and (orientation:landscape) {
.css{}
}
##在Android 上想不顯示語音輸入按鈕,怎么辦?
input::-webkit-input-speech-button {display: none}
##想開發H5搖一搖功能,怎么辦?
HTML5 deviceMotion:封裝了運動傳感器數據的事件,可以獲取手機運動狀態下的運動加速度等數據。