css - Is :last-child:before pseudo selector correct? -
is below css selector correct ?
:last-child:before i've never seen way this, works well.
i wonder way correct or not.
yes absolutely correct. selects last-child of given parent , embeds content before element.
for example, want target last-child of ul element , want add arrow before last element.
ul li:last-child:before { content: "> "; } also, inform last-child won't respect type of element, select last-child of parent, regardless of element, if want target specific element last-child it's parent, use last-of-type instead of last-child
Comments
Post a Comment