问题根本:不要使用line-height
垂直居中。
解决方法:可直接定义height,而后高度由上下padding
值撑开。css
ios input 添加 readonly unselectable=”on” 属性,光标依旧还在html
input聚焦时立刻让它失焦,代码vue
$('input[readonly]').on('focus', function() { $(this).trigger('blur'); });
亲测在苹果手机可行ios
支持微信浏览器的translate写法 其余浏览器须要加上-ms-
-moz-
-webkit
- -o-
web
.parentDiv{ position:relative; } .childDiv{ width:100px; height:100px; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.maskin{ width: 100%; height: 100%; position: fixed; left: 0; right: 0; top: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 99; }
//单行 div{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
在vue中能够使用内联样式循环img :style="{backgroundImage: 'url('+ img +')'}"
浏览器
url-div { width:100px; height:100px; background-image: url(); background-position: center center; background-size: cover; background-repeat: no-repeat; }
.border-1px { position: relative; } .border-1px:after { position: absolute; content: ''; top: -50%; bottom: -50%; left: -50%; right: -50%; -webkit-transform: scale(0.5); transform: scale(0.5); border-bottom: 1px solid #666; }
body { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC","Helvetica Neue",STHeiti,"Microsoft Yahei",Tahoma,Simsun,sans-serif; }
<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
碰到问题还会记录微信