.op-box{
box-sizing: border-box;
position: absolute;
bottom: 0;
left: 0;
width: 100%;
padding: 16rpx;
display: flex;
gap: 16rpx;
}
m***@163.com
- 发布:2024-01-09 17:42
- 更新:2024-01-09 19:18
- 阅读:701
喜欢技术的前端 - QQ---445849201
可以生效,display: flex; 改成 display: grid; 试试
<template>
<view class="container">
<h1>gap</h1>
<view class="container">
<view class="grid-container op-box">
<view class="grid-container-d" v-for="(item,index) in 9" :key="index">item</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
};
},
onLoad() {
},
methods: {
}
};
</script>
<style>
.container{
position: relative;
width: 750rpx;
height: 500rpx;
}
.op-box {
box-sizing: border-box;
position: absolute;
bottom: 0;
left: 0;
width: 100%;
padding: 16rpx;
gap: 16rpx;
display: grid;
grid-template-columns: auto auto auto;
}
.grid-container-d{
border: 1px solid black;
background-color: yellow;
}
</style>