小程序CSS 一行三列布局
作者:xlnxin发布时间:2025-03-12分类:编程知识浏览:778
导读:1、grid网格布局.num-wrap { // grid网格布局 display: grid;...
1、grid网格布局
.num-wrap {
// grid网格布局
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 10px 10px;
}
.num-item {
background-color: #CB812E;
color: #ffffff;
height: 80px;
}2、flex弹性布局 + 伪类选择器
.num-wrap {
// flex弹性布局
display: flex;
flex-wrap: wrap;
}
.num-item {
background-color: #CB812E;
color: #ffffff;
height: 80px;
width: calc((100% - 20px) / 3);
margin-right: 10px;
margin-top: 10px;
}
// 使用css 伪类选择器
.num-item:nth-child(3n) {
margin-right: 0;
}- 上一篇:微信小程序animation底部弹窗动画css代码
- 下一篇:php字符串分隔为数组
相关推荐
- 微信小程序scroll-view实现左右联动上下滚动效果源码
- 新版wxappUnpacker 微信小程序解包实战
- 快来制作个性表情包pk吧
- 微信小程序button如何去掉边框设置透明
- 微信小程序input组件解决iphone拼音字符maxlength长度问题
- 微信小程序弹出对话框输入名字
- 微信小程序页面跳转:wx.switchTab、wx.reLaunch、wx.redirectTo、wx.navigateTo、wx.navigateBack”的使用区别介绍
- 小程序默认icon
- 微信小程序image组件中aspectFill和widthfix、scaleToFill对比
- 鸿蒙电脑如何安装打印机驱动
- 编程知识排行
- 最近发表

