Displaying a menu using the wp_nav_menu function. Adding a menu to your template using CMS WordPress

We invite you to familiarize yourself with new technology on creating a responsive (adaptive) menu without using Javascript. She uses clean and semantic markup HTML5. The menu can be aligned left, center, or right. This menu switches on hover, which is more convenient for users. It also has an indicator that shows the “running/threading” menu item. It works on all mobile and desktop browsers including Internet Explorer!

Target

The purpose of this lesson is to show you how to regular menu make a drop-down menu on a small display.

This trick will be more useful for navigation with a large number links as in the screenshot below. You can condense all the buttons into an elegant dropdown menu.

Nav HTML markup

Here is the markup for navigation. The tag is required to create a drop-down menu with CSS property absolute position. We'll explain this in a lesson later. The .current class points to the active/current menu links.

  • Portfolio
  • Illustration
  • Web Design
  • Print Media
  • Graphic Design

The CSS for navigation (desktop view) is pretty basic, so we're not going to go into too much detail here. Note that we specified display:inline-block instead of float:left in the element's NAV

  • . This will allow the menu buttons to align to the left, center, or right by specifying text-align to