
css
Homilier
晨起迷雾,心有归处,遮不住我前方的路。
展开
-
css图形绘制:实现内凹圆角、月亮、拼图块、优惠券(无隐藏图形遮挡下层元素)
核心知识点:CSS radial-gradient() 函数,用径向渐变创建 "图像"原创 2022-07-12 14:06:29 · 4256 阅读 · 0 评论 -
css阻止IOS长按弹出系统菜单
touch-callout: none;-webkit-touch-callout: none;-ms-touch-callout: none;-moz-touch-callout: none;原创 2021-04-17 16:42:40 · 630 阅读 · 0 评论 -
css仿微信抢红包动画(uniapp)
效果演示:代码:<template> <view> <view v-if="packerState != 3" class="packer-box flex-column"> <view class="packer-bg anim-ease-in" :class="{ 'anim-fade-out': packerState == 2 }"></view> <view class="packer-bottom-原创 2021-03-27 15:53:46 · 1870 阅读 · 3 评论 -
隐藏scroll-view滚动条
::-webkit-scrollbar { width: 0; height: 0; color: transparent;}原创 2021-03-02 09:45:35 · 256 阅读 · 0 评论 -
微信小程序或uniapp调整checkbox、radio、switch组件选中时颜色
微信小程序.wx-checkbox-input-checked,.wx-radio-input-checked,.wx-switch-input-checked { background-color: #0099ff !important; border-color: #0099ff !important; color: #fff !important;}uniapp.uni-checkbox-input-checked,.uni-radio-input-checked,.uni原创 2021-03-02 09:43:29 · 2167 阅读 · 0 评论 -
input、textarea设置光标颜色
input,textarea { caret-color: #0099ff;}原创 2021-03-02 09:38:09 · 1135 阅读 · 0 评论 -
css适配iphonex底部安全区
.safe-area-inset-bottom { padding-bottom: 0; padding-bottom: constant(safe-area-inset-bottom); // 兼容 IOS<11.2 padding-bottom: env(safe-area-inset-bottom); // 兼容 IOS>=11.2}注:H5设置meta标签viewport-fit值为cover才有效(小程序默认),即令页面内容充满可视窗口,而非默认auto/c..原创 2021-03-02 09:34:51 · 2742 阅读 · 0 评论 -
css限制文字行数
限制单行文字.single-text { min-width: 0; // 防止其他元素被挤压 text-overflow: ellipsis; // 超出文字显示... word-break: break-all; overflow: hidden; white-space: nowrap;}限制两行以上文字.double-text { min-width: 0; // 防止其他元素被挤压 overflow: hidden; text-overflow: ellipsi.原创 2021-03-02 09:14:11 · 736 阅读 · 0 评论 -
CSS的3D应用:立方体沿边翻滚动画
实现效果:代码实现:<view class="page"> <view class="m-30" style="margin-top: 90rpx;">翻滚吧!立方体!</view> <view class="board"> <!-- start 参考线 --> <view style="position: absolute; font-size: 0; transform: translateZ(-72rpx);"原创 2020-07-21 17:28:42 · 428 阅读 · 0 评论 -
CSS的3D应用:绘制长方体
实现效果:绘制步骤:① 绘制6个面,2个正方形 + 4个长方形② 旋转各个面的角度③ 摆放各个面的位置代码实现:<div class="cuboid"> <div class="bottom">下</div> <div class="top">上</div> <div class="right">右</div> <div class="left">左</div>原创 2020-07-21 17:08:54 · 2550 阅读 · 0 评论 -
CSS的3D应用:绘制立方体
实现效果:绘制步骤:① 绘制6个正方形② 旋转各个正方形的角度③ 摆放各个正方形的位置代码实现:<div class="cube"> <div class="bottom">下</div> <div class="top">上</div> <div class="right">右</div> <div class="left">左</div> <div c原创 2020-07-21 16:52:08 · 1261 阅读 · 0 评论 -
清除button所有样式
button { margin: 0; padding: 0; outline: none; border-radius: 0; background-color: transparent; line-height: inherit; width: max-content;}button:after { border: none;}原创 2019-10-24 23:40:59 · 6830 阅读 · 5 评论 -
IOS上input/textarea组件输入光标太高/太长的调整办法
假如希望input的高度是40px,把height/line-height的值设置为足够显示内容的值或者光标的最大理想高度,其余高度用padding填充保证输入组件有足够的响应区域。input { padding: 10px 0; height: 20px; line-height: 20px;}...原创 2019-10-19 10:41:12 · 1463 阅读 · 0 评论 -
设置input和textarea光标颜色
input,textarea { caret-color: #FA0560;}原创 2019-10-19 10:28:04 · 1958 阅读 · 0 评论