CSS selectors - targeting descendant li elements

Hi all,

I’m trying to select all li elements within the nav element with a class of “navbar-header”. I tried the following selector but it didn’t work:

.navbar-header ul li {
  transform: uppercase;
}

Just wondering if I could get some help with this as I’m not sure how to target it correctly?

Thanks in advance.

  <nav class="navbar-header">
    <div class="container">
      <a class="navbar-brand" href="#" title="">
        <img src="#" alt="">
      </a>
      <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
      </button>
      <div class="collapse navbar-collapse" id="navbarNav">
        <ul class="navbar-nav d-flex-lg align-items-lg-center">
               <li class="nav-item">
            <a class="nav-link" href="#" title="">Link 1</a>
          </li>
   <li class="nav-item">
            <a class="nav-link" href="#" title="">Link 2</a>
          </li>
   <li class="nav-item">
            <a class="nav-link" href="#" title="">Link 3</a>
          </li>
        </ul>
        <ul class="navbar-nav d-flex-lg align-items-lg-center">
          <li class="nav-item">
            <a class="nav-link btn btn-primary" href="#" title="">Button</a>
          </li>
        </ul>
      </div>
    </div>
  </nav>
  

That’s a new one on me :slight_smile:

2 Likes

Oops! Sorry - text-transform did it. Thanks

2 Likes