{"id":11861,"date":"2022-02-07T08:53:41","date_gmt":"2022-02-07T13:53:41","guid":{"rendered":"http:\/\/local.brightwhiz\/?post_type=snippets&p=11861"},"modified":"2022-02-07T08:53:43","modified_gmt":"2022-02-07T13:53:43","slug":"select-last-child-css","status":"publish","type":"snippets","link":"http:\/\/local.brightwhiz\/snippets\/select-last-child-css\/","title":{"rendered":"Selecting the Last Child in CSS"},"content":{"rendered":"\n
p:last-child {\n font-size: 0.75em;\n}<\/code><\/pre>\n\n\n\nCSS’s last child with class. This will only work if the last child has the class .myclassName<\/code>.<\/p>\n\n\n\n.myClassName:last-child {\n background: blue;\n}<\/code><\/pre>\n\n\n\nThis will only work if the last child of #myId<\/code> has the class .myclassName<\/code>.<\/p>\n\n\n\n#myId .myClassName:last-child {\n background: blue;\n}<\/code><\/pre>\n","protected":false},"comment_status":"open","ping_status":"closed","template":"","meta":[],"categories":[],"tags":[],"yoast_head":"\nSelecting the Last Child in CSS<\/title>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\n