G
G
GrimJack2017-07-23 15:12:16
Layout
GrimJack, 2017-07-23 15:12:16

Is it possible in scss to check for the presence of a nested selector?

Hello everyone, I'm learning to type in scss and the question arose, is it possible to make a rule only for those elements that have a nested selector?
For example:

<ul>
   <li><span><a href="#">About</a></span></li>
   <li><i class="icon-menu icon-position-left"></i><span><a href="#">How it works</a></span>
   <ul>
          <li><span><a href="#">Installation</a></span></li>
          <li><span><a href="#">Features</a></span></li>
          <li><span><a href="#">Updates</a></span></li>
          <li><span><a href="#">Tutorials</a></span></li>
   </ul>
</li>
<li><span><a href="#">Stories</a></span></li>
</ul>

Now there is such a code (I would like to hear constructive criticism from it too) https://codepen.io/anon/pen/qXWeRO
You can see that the dropdown for the second li works on any li, how can I fix this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
andead, 2017-07-23
@GrimJack

.nav:hover li ul
replaced by
.nav li:hover ul

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question