remjavascript
相对于根元素css
html{
/* 1 rem */
font-size: 16px;
}
div{
/* 20*16px */
width: 20rem;
/* 20*16px */
height: 20rem;
}
复制代码
emhtml
字体相对于根元素计算,其余元素相对于当前元素java
html{
/* 1 rem */
font-size: 16px;
}
div{
font-size: 18px;
/* 20*18px */
width: 20em;
/* 20*18px */
height: 20em;
}
复制代码
touchstart
触摸touchmove
移动touchend
离开touchcancel
系统中止跟踪触摸时(打断)tap
点击一下longTap
长按singleTap
碰一下doubleTap
双击swipe
滑动swipeLeft
向左滑动swipeRight
向右滑动swipeUp
向上滑动swipeDown
向下滑动<!--css-->
<style> *{ padding: 0; margin: 0; } div{ width: 2rem; height: 2rem; position: relative; } button{ width: .5rem; height: .3rem; position: absolute; z-index: 2; } div::before{ content: ''; display: block; width: 200%; height: 200%; top: 0; left: 0; border: 1px solid #eeeeee; -webkit-transform: scale(0.5); transform: scale(0.5); transform-origin: 0,0 position: absolute; z-index: 1; } </style>
<!--html-->
<body>
<div>
<button>点击</button>
</div>
</body>
<!--js-->
<script> var Obtn = document.getElementsByTagName("button")[0]; Obtn.onclick = function(){ alert("hello world"); } </script>
复制代码
background-color:#ff7e33;
background-image:linear-gradient(45deg,#ff5303,#ff9143);
复制代码
vconsole会报错script error ,但没法查出具体错误 须要加垫片babel-polyfillios
(安卓手机会出现) 从新获取⻚⾯高度并赋值es6
ios系统⼀般会出现拍照和相册两个选项,安卓手机拍照、相册选择有时只出现⼀ 项,有时根据系统不一样会展现其余项,12306的webview不⽀持input file 会出现闪退的状况web
解决方法babel
须要阻止页面的默认动做app
-webkit-appearance: none;
复制代码
能够设置input高度小⼀点 而后上下加padding字体
网上的解决方式line-height:normal