What CSS selector can be used to select all odd elements inside a parent, but which are not necessarily siblings?
2条回答 天涯浪人 (楼主) 2021-01-16 05:58 While it uses JavaScript, you could style the odd element without altering your markup: $('.parent .element:odd').css('font-weight', 'bold'); http://jsfiddle.net/ansonhoyt/MfxYF/ 0 讨论(0) 查看其它2个回答 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复
While it uses JavaScript, you could style the odd element without altering your markup:
$('.parent .element:odd').css('font-weight', 'bold');
http://jsfiddle.net/ansonhoyt/MfxYF/