Hello,
I’m trying to have a right margin of 0 for the last list item in my #homeNav element. I tried the “last-child” pseudo class selector but it is not doing anything.
Note: I have not uploaded my changes to the server, I’m currently working on this locally. With that said…
Aha! Thanks! I fixed it to:
#homeNav[B] ul[/B] > li:last-child a {
margin-right: 0;
}
That worked! However, I still don’t quite understand why the pseudo class did not work as:
#homeNav ul > li:last-child {
margin-right: 0;
}
I removed the “a” from that. Why does it matter if it has the a in it since we’re just concerned about removing the right margin from the last <li>? Why doe sit matter if we have “a” selector in the declaration?