clip-path 属性使用裁剪方式创建元素的可显示区域。区域内的部分显示,区域外的隐藏。可
<div class="letter">开始游戏</div>.letter{ width: 200px; height: 100px; text-align: center; line-height: 100px; background: rgb(255, 200, 42); font-size: 36px; font-weight: 400; z-inde
在安卓手机上line-height居中会有偏差 导致样式不对在css按钮中加上 按钮是用div标签display: flex;justify-content: center;align-items: center;这样偏差会很小 但是我还是觉得不是很完美也有的方法是不要给line-height来垂直居中 用padding 给值把按钮撑开不要给宽高 我发现还是达不到要求 在个别安卓手机上还是偏差很大最完美的解决方式是按钮直接用图片 可是如果按钮颜色文字 各不相同 那图片就有点多 也是
//在全局设置*{ -webkit-tap-highlight-color: rgba(255, 255, 255, 0);}
padding-bottom: constant(safe-area-inset-bottom); /* 兼容 iOS < 11.2 */padding-bottom: env(safe-area-inset-bottom);在底部导航css样式中加入改代码 导航会在iphone X手机上 会自动向上padding值 防止iphone X 底部的横线遮住 页面导航...
有的时候我们的需求是超出两行省略显示点点我们都会用js去判断字符串长短css也可以实现overflow: hidden;font-size: 0.14rem;text-overflow: ellipsis;display: -webkit-box;-webkit-line-clamp: 2;/*这就是几行的意思 可以自己设定自己要几行展示*/-webkit-box-orient: vertical;文字很多 但是依旧只显示两行并自动省略...
<div></div>用position第一种body,html{ width: 100%; height: 100%;}div{ width: 200px; height: 200px; position: absolute; left: 0; right: 0; top: 0; bottom: 0; background: #009688; margin: auto;}/*left,right,top,bottom都给0 margin..
<div class="left"> 左 </div> <div class="right"> 右 </div>第一种 浮动.left{ width: 200px; float: left; height: 200px; background: #0000FF; }.right{ margin-left: 200px; height: 200px; background: #00FF00;}弟二种 计算.
Copyright © 2005-2024 51CTO.COM 版权所有 京ICP证060544号