Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

<li> question

Featured Replies

Hey 2 things. Whats does the following mean?

 

.nav-custom > li + li

 

And secondly how can I center my nav within a div (using bootstrap)

 

Thanks

The > selector targets elements that are direct children of the parent. The + selector targets elements immediately preceded by another element, in this case an LI.

 

So that statement says: Any LI that is a direct child of .nav-custom AND has an LI element immediately preceding it.

 

  <ul class="nav-custom">
    <li></li>  <!-- Direct child of .nav-custom, but not preceded by an LI -->
    <li></li>  <!-- Direct child of .nav-custom, AND preceded by an LI - this would get styled -->
    <li>
      <ul>
        <li></li>  <!-- Not a direct child of .nav-custom, so not affected -->
        <li></li> 
      </ul>
    </li>
  </ul>

 

The > selector is used, in this case, to target list items in the navigation menu, but NOT in the drop down menus. And the + selector may be used for something like adding a top border to the list item, but they don't want the first one to have a top border, so it must be preceded by an LI.

 

These selectors are very useful - get to know them!

Yes the plus operator selects the next li.

 

Its problably best though to use the :first-child or :nth-child(x) pseudo selector as it easier to debug.

 

Only IE7 and above.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.