微信小程序 :first-child 选择器失效
<!-- 列表 -->
<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{
...
}
难道小程序不支持伪类选择器吗
...全文
相关推荐
CSS3的first-child选择器实战攻略
### CSS3的first-child选择器实战攻略知识点总结#### 1. first-child与:first-of-child的区别- **first-child选择器**:该选择器用于选择父元素中的第一个子元素
浅谈jquery选择器 :first与:first-child的区别
而`:first-child`则可以用来选取`body`下的所有首子元素,如`$("body *:first-child")`,这将包括所有作为其父元素的第一个子元素的元素。
css选中父元素下的第一个子元素(:first-child)
</p></div>```对应的CSS为:```cssdiv > p:first-child { background-color: yellow;}```这样,只有`<div>`内的第一个`<p>`会被选中
jQuery中:first-child选择器用法实例
`:first-child`选择器的基本语法是 `$(“:first-child”)`,这将选取所有符合该条件的元素。然而,在实际应用中,通常会与其他选择器结合使用,以更精确地定位目标元素。
IE8下CSS3选择器nth-child() 不兼容问题的解决方法
eee 1px solid; float: left; } div ul li:first-child { background: #ccc; /* 选取第一个li */ } div ul li:first-child


