Answer the question
In order to leave comments, you need to log in
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
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 {}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question