nth-last-child和nth-last-of-type

nth-last-child和nth-last-of-type


问题描述:

nth-last-of-type() 同种标签倒数选择,nth-last-child() 任意指定标签倒数选择

是这样吗?

正在回答

登陆购买课程后可参与讨论,去登陆

1回答

同学你好,解答如下:

1、nth-last-of-type() 的理解是正确的,如下:

http://img1.sycdn.imooc.com//climg/6107b8150993d3df05030444.jpg

http://img1.sycdn.imooc.com//climg/6107b82809c1f87a03570255.jpg

2、nth-last-child() 任意指定标签倒数选择”这句话描述的不是很对,容易歧义。nth-last-of-type是“不区分类型,从最后一个元素开始计数,所有同级子元素都参与计数”,例如:

http://img1.sycdn.imooc.com//climg/6107b8a109195c0806870466.jpg

http://img1.sycdn.imooc.com//climg/6107b8a809af976804030250.jpg

祝学习愉快!​


问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星
请稍等 ...
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师