V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
Ashore
V2EX  ›  问与答

请教一个 css 的问题。

  •  
  •   Ashore · 113 天前 · 140 次点击
    这是一个创建于 113 天前的主题,其中的信息可能已经有所发展或是发生改变。

    企业微信截图_17046967413709.png

    如上图所示,在 itemContainer 中每一行中 item 的数量不固定,宽度也不固定。我想让最后一行的数据在 space-between 靠左对齐,最后一行不要有 margin-bottom 。请问该怎么写 css 样式呢?作为后端的我真的是很费解啊。。

    这是我现在的代码。

    
    <view class="cateview" v-for="index in 4" :key="index">
    			<view class="catetitle">项目类型</view>
    			<view class="cateItemContainer">
    				<view class="cateitem">app 拉新</view>
    				<view class="cateitem">纯关注或纯注册</view>
    				<view class="cateitem">微信加好友</view>
    				<view class="cateitem">实名认证</view>
    				<view class="cateitem">电销引流</view>
    				<view class="cateitem">任务量</view>
    				<view class="cateitem">充场</view>
    			</view>
    		</view>
    
    
          .cateItemContainer {
    		margin-top: 28rpx;
    		width: 100%;
    		display: flex;
    		align-items: center;
    		justify-content: space-between;
    		flex-wrap: wrap;
    	}
    
    	.cateitem {
    		box-sizing: border-box;
    		padding: 12rpx 23rpx;
    		background: #f7f7f7;
    		border-radius: 10rpx;
    		font-size: 24rpx;
    		text-align: center;
    		color: #333333;
    		display: flex;
    		align-items: center;
    		justify-content: center;
    		margin-bottom: 20rpx;
    	}
    	
    	.cateitem:last-child {
    	  margin-right: auto;
    	}
    
    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1087 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 18:12 · PVG 02:12 · LAX 11:12 · JFK 14:12
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.