微信小程序 :first-child 选择器失效

如此美丽的你 2020-08-11 03:43:18


<!-- 列表 -->
<view class="floor_list">
<view class="fff"></view>
<navigator wx:for="{{item.product_list}}" wx:key="name" wx:for-item="item2" wx:for-index="index2">
<image mode="widthFix" src="{{item2.image_src}}"></image>
</navigator>
</view>



这么写不起作用
.floor_list:first-child {
width: 33.33%;
height: 20rpx;
background-color: red;
}

这么写有用
.floor_list fff{
...
}

难道小程序不支持伪类选择器吗
...全文
856 1 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
chenrynet 2020-08-11
  • 打赏
  • 举报
回复
.floor_list:first-child floor_list父元素的首个.floor_list元素

87,997

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧