herrfischer
herrfischer

Reputation: 1828

Select penultimate element

I want to select the penultimate element with CSS. The code looks this way:

enter image description here

so I tried this:

.panel-default > [id^=heading]:last-of-type {
    border-bottom: 5px solid blue;
}

But with no luck. Any idea how to always select the last "panel-heading" element?

Upvotes: 6

Views: 1362

Answers (1)

Mark Perera
Mark Perera

Reputation: 662

try

.panel-default > *:nth-last-of-type(2) {
    border-bottom: 5px solid blue;

}

Upvotes: 6

Related Questions