how to select only last 2 child use css code example Example: css last 3 childs #something a:nth-last-child(-n+3) { /*declarations*/ }