Schema Markup Drop-Down Navigation menu

SEO Help and Tips

Schema Markup Drop-Down Navigation menu

SEO Responsive Menu.
Here's the Drop-Down navigation menu code with search index helpful Schema.org markup for the menu using the BreadcrumbList schema:

<style>
  /* CSS styling for the navigation menu */
  ul.nav-menu {
    list-style-type: none;
    margin: 0;
    padding: 0;
    display: inline;
  }
  ul.nav-menu li {
    display: inline-block;
    margin-right: 10px;
    position: relative; /* Added position relative */
  }
  ul.nav-menu li a {
    text-decoration: none;
    padding: 5px 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    color: #333;
  }
  ul.nav-menu li a:hover {
    background-color: #05b34b; /* Changed hover background color to a green color */
    color: white; /* Changed hover font color to white */
  }

  /* Added CSS for dropdown menu */
  ul.nav-menu ul.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #fff;
    padding: 5px;
    border: 1px solid #ccc;
  }
  ul.nav-menu li:hover ul.dropdown-menu {
    display: block;
  }
  ul.nav-menu li:hover ul.dropdown-menu li {
    display: block;
    margin: 5px 0;
  }

  /* Added CSS to change font color to red */
  ul.nav-menu li a {
    color: red;
  }
</style>

<div itemscope itemtype="https://schema.org/BreadcrumbList">
  <nav-menu="Breadcrumb">
    <ul class="nav-menu">
      <li itemscope itemtype="https://schema.org/ListItem">
        <a href="https://example.com" itemprop="item">
          <span itemprop="name">Home</span>
        </a>
        <meta itemprop="position" content="1" />
      </li>
      <li itemscope itemtype="https://schema.org/ListItem">
        <a href="https://example.com/p/about-us.html" itemprop="item">
          <span itemprop="name">About</span>
        </a>
        <meta itemprop="position" content="2" />
        <ul class="dropdown-menu">
          <li itemscope itemtype="https://schema.org/ListItem">
            <a href="https://example.com/p/terms-of-service.html" itemprop="item">
              <span itemprop="name">Terms of Service</span>
            </a>
            <meta itemprop="position" content="1" />
          </li>
          <li itemscope itemtype="https://schema.org/ListItem">
            <a href="https://example.com/p/privacy-policy.html" itemprop="item">
              <span itemprop="name">Privacy Policy</span>
            </a>
            <meta itemprop="position" content="2" />
          </li>
          <li itemscope itemtype="https://schema.org/ListItem">
            <a href="https://example.com/p/contact-us.html" itemprop="item">
              <span itemprop="name">Contact Us</span>
            </a>
            <meta itemprop="position" content="3" />
          </li>
          <li itemscope itemtype="https://schema.org/ListItem">
            <a href="https://example.com/p/logo.html" itemprop="item">
              <span itemprop="name">Logo</span>
            </a>
            <meta itemprop="position" content="4" />
          </li>
        </ul>
      </li>
      <li itemscope itemtype="https://schema.org/ListItem">
        <a href="https://example.com/p/services.html" itemprop="item">
          <span itemprop="name">Services</span>
        </a>
        <meta itemprop="position" content="3" />
        <ul class="dropdown-menu">
          <li itemscope itemtype="https://schema.org/ListItem">
            <a href="https://example.com/p/home.html" itemprop="item">
              <span itemprop="name">Home</span>
            </a>
            <meta itemprop="position" content="1" />
          </li>
          <li itemscope itemtype="https://schema.org/ListItem">
            <a href="https://example.com/p/category.html" itemprop="item">
              <span itemprop="name">Category</span>
            </a>
            <meta itemprop="position" content="2" />
          </li>
          <li itemscope itemtype="https://schema.org/ListItem">
            <a href="https://example.com/p/subcategory.html" itemprop="item">
              <span itemprop="name">Subcategory</span>
            </a>
            <meta itemprop="position" content="3" />
          </li>
        </ul>
      </li>
      <li itemscope itemtype="https://schema.org/ListItem">
        <a href="https://example.com/p/question-and-answere.html" itemprop="item">
          <span itemprop="name">Q&amp;A</span>
        </a>
        <meta itemprop="position" content="4" />
      </li>
    </ul>
  </nav-menu>
</div>


I added the necessary Schema.org markup to each list item using the ListItem schema. The itemprop="itemListElement" attribute indicates that each list item is part of the breadcrumb list. The itemprop="item" attribute specifies the URL of the item, and the itemprop="name" attribute provides the name of the item.

Additionally, the meta tag with the itemprop="position" attribute indicates the position of each item in the breadcrumb list.

Comments

Popular posts from this blog

How to fix SSL Certificate Issues?

How to Fix Website Mixed Content Issues?

How to Fix Mobile Responsiveness Issues?

Popular posts from this blog

How to fix SSL Certificate Issues?

How to Fix Website Mixed Content Issues?

How to Fix Mobile Responsiveness Issues?