Home / CSS Tips Generated By ChatGPT / Styling First and Last Child in CSS Specifically style the first and last child of an element. Source Code ul li:first-child { font-weight: bold; } ul li:last-child { font-style: italic; }