Which style rule will underline the last item in an ordered list?
ol li:last {text-decoration: underline;}
ol li:last-of-type {text-decoration: underline;}
ol li#last {text-decoration: underline;}
ol li.last-of-type {text-decoration: underline;}
SOLUTION :
ol li:last-of-type {text-decoration: underline;} is the right answer.
EXPLANATION :
EXAMPLE PROGRAM :
<!DOCTYPE html>
<html>
<body>
<head>
<style>
ol li:last-of-type {text-decoration: underline;}
</style>
</head>
<h2>Ordered list</h2>
<ol>
<li>Alpha</li>
<li>Beta</li>
<li>Gamma</li>
</ol>
</body>
</html>
OUTPUT :
Get Answers For Free
Most questions answered within 1 hours.