A Very Simple Mistake We do in Css

Sometimes we want to Customize some of articles or sections which are at last or sometimes we want to make some changes in the last article or section then we write last child

example:-

section.content:last-child{border-bottom:0;}

than we find that it does not work and we can not find the mistake.

Solution:- The mistake is in the selector of the above example,

This won’t be like this

section.content:last-child{border-bottom:0;}

Actually this is not a last child, This is a selector called “last-of-type”. Now do this ¬†like below,

section.content:last-of-type{border-bottom:0;}

This will work perfectly.

Keep learning


Leave a Reply