last-child

using last-child in css

the below css doesnt works on below given html. The purpose is to apply the css on the last 'li', but it doesnt. #refundReasonMenu #nav li:last-child { border-bottom: 1px solid #b5b5b5; } and html looks like <div id="refundReasonMenu"> <ul id="nav"> <li><a id="abc" href="#">abcde</a></li> <li><a id="def" href="#">xyz</a>...

Css specificity :last-child

I would like to use the following to target the last link (a) of the last ul inside my div. So this is what came to mind: #menu ul:last-child li a { /*.....*/ } I cant manually add a class to that element, and even if i wanted to do it dynamically i would still have to target the element the above way. Any ideas why this is no...

Why ":last" and ":last-child" does not work ?

I'm trying to select the last div with class my_class inside div with id a. I tried several options with :last and :last-child but none of them worked. Here is on try. What am I doing wrong ? ...

:last-child style working, :first-child style not working! Why?

I'm creating an inset border effect between paragraphs by using a light border as the border-top on the paragraphs, and a dark border as the border bottom on them. I'm trying to use p:first-child to remove the top border on the first paragraph, and p:last-child to remove the border on the bottom one. (they have a class of "intro" fyi). ...

:last-child psuedo class selector in CSS and Internet Explorer

Hi All, I have the following code: ul.myList li{ border-right: 1px dotted #000; } However, on the last element, I need to remove that border as the design that I am working from dictates that the last item does not require a border as a separator. So, I need to target the last child of a list and so within my css I have added ...

css3 last-child not working as expected

I have match listings dynamically generated. After each member I display a li that displays VS within it. However the very last ul li in the div match shouldnt be visible. Any ideas how I can do that? HTML <style> .match { } .match ul { } .match ul li { float: left; margin-right: 50px; } .mat...

CSS :last-child

Hello! I have a div#content with many div.item inside it. When using :last-child to make the last div.item with no border-bottom, it's OK. But, as the content is dynamically appended using php and mysql results I'm using a conditional pagination table that will be appended after the last div.item which means at the bottom of the div#cont...