L
L
Lord_North2021-06-11 11:13:40
css
Lord_North, 2021-06-11 11:13:40

How to access header > nav > ul > li > ul > li > a?

Hello. Can't access tag a:

<header>
     <nav class="dropdown">
          <ul class="dropdown-items">
               <li>
                    <ul class="menu-items">
                         <li class="pcv1">
                              <a class="25w">Help me</a>
                         </li>
                    </ul>
               </li>
          </ul>
     </nav>
</header>

Sorry for such a stupid question. But I don't understand why it doesn't work:
.dropdown .dropdown-items li .menu-items .pcv1 .25w {background:red}

I will be grateful for any help. Well, yes, you can set an id for the a tag, but still...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
approximate solution, 2021-06-11
@Lord_North

.dropdown .dropdown-items li .menu-items .pcv1 .25w

When writing styles, try not to nest more than two.
.dropdown
   .dropdown-items
   .menu-items
   .pcv1

It's easier to create an additional class, and then not chug with such questions and redefining styles.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question