0

Hey I'm using webflow to create my web project. Webflow gives active links an class called .w--current, that's their "active". So the link class looks like this when a webpage is open .nav__link .w--current.

How can I give in this specific case the .w--current element an ::before pseudo? I tried all kind of ways like .nav__link .w--current::before or .nav__link:before .w--current:before but none of them worked. Can I generally add an pseudo element to an CSS class which is at the second position?

EternalHour
  • 8,308
  • 6
  • 38
  • 57
p_e_88
  • 1,029
  • 11
  • 24
  • Duplicate: https://stackoverflow.com/questions/2554839/select-element-based-on-multiple-classes – Quentin Oct 10 '19 at 16:24
  • 1
    You've misidentified the problem. It's the descendant combinator you've put between the class selectors. Nothing to do with the pseudo-element. – Quentin Oct 10 '19 at 16:25
  • What did you try? Show the CSS you tried to apply as well as a simple HTML markup. It could be as simple as you didn't add the `content` property to the pseudo element. – disinfor Oct 10 '19 at 16:26
  • Or if there is only ever one element with class `w--current` at any one time, just `.w--current` for a selector will do. – Mr Lister Oct 10 '19 at 19:28

1 Answers1

1

The empty space between both classes was my problem.

The correct solution is: .nav__link.w--current:before

p_e_88
  • 1,029
  • 11
  • 24