CSS: How to Style the Last Element of a Class
To\u0020make\u0020the\u0020last\u0020element\u0020of\u0020class\u0020"qq_product_in_list"\u0020have\u0020a\u0020different\u0020style,\u0020you\u0020can\u0020use\u0020the\u0020"\u003alast-of-type"\u0020selector\u0020instead\u0020of\u0020"\u003alast-child".\u0020Here's\u0020the\u0020updated\u0020CSS\u0020code:\u000a\u000a.qq_product_in_list\u0020{\u000a\u0020\u0020border-radius:\u00200px;\u000a\u0020\u0020border-top:\u00201px\u0020solid\u0020#F1F2F4;\u000a\u0020\u0020border-left:\u00201px\u0020solid\u0020#F1F2F4;\u000a\u0020\u0020border-right:\u00200px;\u000a\u0020\u0020border-bottom:\u00200px;\u000a}\u000a\u000a.qq_product_in_list\u003alast-of-type\u0020{\u000a\u0020\u0020border-left:\u0020none;\u000a\u0020\u0020background:\u0020red;\u000a}\u000a\u000aThis\u0020should\u0020apply\u0020the\u0020background\u0020color\u0020"red"\u0020to\u0020the\u0020last\u0020element\u0020with\u0020class\u0020"qq_product_in_list".\u000a
原文地址: http://www.cveoy.top/t/topic/poUi 著作权归作者所有。请勿转载和采集!