1.一定要保证前面没有兄弟节点,要么就用div包住
2.img:first-of-type{}也能达到first-child的效果,且前面可以有节点
3.img:nth-of-type(1){}也能达到first-child的效果,且前面可以有节点
1.一定要保证前面没有兄弟节点,要么就用div包住
2.img:first-of-type{}也能达到first-child的效果,且前面可以有节点
3.img:nth-of-type(1){}也能达到first-child的效果,且前面可以有节点