<p>Say I have a list as follows:</p>

<ul>
<li>item1</li>
<li>item2</li>
<li>item3</li>
</ul>

<p>Is there a CSS selector that will allow me to directly select the last item of a list? In this case item 3.</p>

<p>Cheers!</p>

[{'answer_id': 51159, 'author': 'Glenn Slaven', 'author_id': 2975, 'author_profile': 'https://Stackoverflow.com/users/2975', 'pm_score': 5, 'selected': True, 'text': '<p>Not that i\'m aware of.  The traditional solution is to tag the first &amp; last items with class="first" &amp; class="last" so you can identify them.</p>\n\n<p>The CSS psudo-class <a href="http://www.w3.org/TR/CSS2/selector.html#first-child" rel="noreferrer">first-child</a> will get you the first item but not all browsers support it. CSS3 will have <a href="http://www.w3.org/TR/2001/CR-css3-selectors-20011113/#last-child-pseudo" rel="noreferrer">last-child too</a> (this is currently supported by Firefox, Safari but not IE 6/7/beta 8)</p>\n'}, {'answer_id': 51485, 'author': 'Bobby Jack', 'author_id': 5058, 'author_profile': 'https://Stackoverflow.com/users/5058', 'pm_score': 3, 'selected': False, 'text': '<p>Until it\'s properly supported, you\'ll need to add a class to \'last\' items, as suggested. You don\'t have to do this manually, though. If you can take a javascript hit, take a look at either:</p>\n\n<ul>\n<li><a href="http://docs.jquery.com/Selectors/lastChild" rel="noreferrer">the jQuery :last-child selector</a></li>\n<li><a href="http://www.alistapart.com/articles/keepelementskidsinlinewithoffspring" rel="noreferrer">Keeping Your Elements’ Kids in Line with Offspring</a> (a list apart article by Alex Bischoff), a specific, lighter-weight method</li>\n</ul>\n\n<p>Either will avoid \'polluting\' your markup, and are perfectly acceptable if your style is a \'nice addition\' as opposed to a \'must have\' design feature.</p>\n'}, {'answer_id': 13222550, 'author': 'OZZIE', 'author_id': 846348, 'author_profile': 'https://Stackoverflow.com/users/846348', 'pm_score': 2, 'selected': False, 'text': '<p>The answer for this question should be updated! IE9 + Firefox (for a while back) + Chrome, Safari all support: <code>last-of-type</code> or <code>last-child</code> </p>\n'}]
['https://Stackoverflow.com/questions/51156', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/131/']