<html>
<head>
<style>
ul > :first-child {
background:yellow;
}
</style>
</head>
<body>
<ul>
<li>Coffee</li>
<li>Tea</li>
<li>Coca Cola</li>
</ul>
<ul>
<li>Coffee</li>
<li>Tea</li>
<li>Coca Cola</li>
</ul>
<p><b>Note:</b> For :first-child to work in IE8 and earlier, a DOCTYPE must be declared.</p>
</body>
<!-- Mirrored from www.w3schools.com/cssref/tryit.asp?filename=trycss_sel_firstchild_more4 by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 03:11:40 GMT -->
</html>