0

Hy, I'm trying to select in my DOM the last div of a certain type, wich content a class call 'visible'. But it just doesnt work. Here's my code:

.section [class ~= "visible"]:last-of-type{
    margin-bottom: 100px;
}

Is it possible to do it? Thanks for your help.

BoltClock
  • 700,868
  • 160
  • 1,392
  • 1,356
Kevin
  • 4,823
  • 6
  • 36
  • 70
  • 1
    There's no `:last-of-class` selector in CSS. CSS Selectors don't stack; Therefore there's no possible way to select the last element having a certain class. – Hashem Qolami Feb 26 '15 at 09:05
  • Any reason you used a class selector for `.section` but an attribute selector for the visible class? Couldn't you just use class selectors for both? – BoltClock Feb 26 '15 at 09:07
  • Check out [SelectorGadget](http://selectorgadget.com/) it can teach you some nasty css selector combinations :) – Drops Feb 26 '15 at 09:16

0 Answers0