S
S
Semyon Zadorozhny2017-04-15 19:19:24
css
Semyon Zadorozhny, 2017-04-15 19:19:24

What is the correct way to add a property to a block child via ::before for a :last-child element with a specific class name?

What is the correct way to add a property to a block child via ::before for a :last-child element with a specific class name?
sample code here : https://codepen.io/Simonz/pen/NjqWJw
the markup is dynamic, the number of children changes, it is necessary that the last element with the v-has-height class, the ::before pseudo-element has a limited height

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
tarthur, 2017-04-15
@tarthur

do you add new elements through js? if so, remove the last class from all v-has-height from the beginning, then you can find the element eg. through
and assign the class last
or even easier through jquery
if not, then just give the last class last (in the html code) and give it styles already:

& > .v-panel.v-has-height.last {
    &::before {}
}

S
Semyon Zadorozhny, 2017-04-15
@Senchaz

there is no way to change the markup, js is not allowed =(

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question