mobile-nav__label hidden by main-content / URGENT

Highlighted
New Member
6 0 0

Hello,

In mobile device, mobile-nav__label are hidden by the main-content. I can't click on the links. I tried to find many solutions but I didn't succeed in solving it! Any idea? I found different things like the z-index but I don't know where to look in shopify code. 

 

Thanks for the help! Capture d’écran 2020-07-04 à 22.33.11.png

0 Likes
Highlighted
Shopify Partner
1685 365 497

Hey @Camille3,

You can find this code in the Online Store->Theme->Edit code->Assets->theme.scss.liquid file.

You will get this code in the above file. so please check.

Thanks!

If helpful then please Like and Accept Solution.
Do you need custom changes on store ? Hire me.
Feel free to Contact me on dmw.webartisan@gmail.com
Follow us on Instagram @dmw.webartisan
0 Likes
Highlighted
New Member
6 0 0

Hello! I know where is the code seeing that I developped everything. It is not my question. The problem is that the div "main-content" hides my "mobile-nav-link" like on the picture. So I need to know a css command to solve this! Thank you for your help. 

0 Likes
Highlighted
Shopify Partner
1685 365 497

Hey @Camille3,

Please provide your website URL. I will provide a solution here.

Thanks!

If helpful then please Like and Accept Solution.
Do you need custom changes on store ? Hire me.
Feel free to Contact me on dmw.webartisan@gmail.com
Follow us on Instagram @dmw.webartisan
0 Likes
Highlighted
New Member
6 0 0

Thanks! Here is the Url https://societe-dmd.myshopify.com/ 

0 Likes
Highlighted
Shopify Partner
1685 365 497

Hey @Camille3,

There are no href links on the items of the menu on mobile. Are you using the different menu for mobile devices?

Thanks!

If helpful then please Like and Accept Solution.
Do you need custom changes on store ? Hire me.
Feel free to Contact me on dmw.webartisan@gmail.com
Follow us on Instagram @dmw.webartisan
0 Likes
Highlighted
New Member
6 0 0

Hello, 

No I just use one menu for mobile devices. The links are in the menu. Seeing that when I tried to move a little the main content, links under worked. I guess the problem is just because of the div which is on the menu. But I don't know how to do. Here is my code. 

<nav class="mobile-nav-wrapper medium-up--hide" role="navigation">
<ul id="MobileNav" class="mobile-nav">
{% for link in linklists[section.settings.main_linklist].links %}
{%- assign outerLoopIndex = forloop.index -%}

<li class="mobile-nav__item{% unless forloop.last %} border-bottom{% endunless %}">
{% if link.links != blank %}
{% capture child_list_handle %}{{ link.handle }}-{{ outerLoopIndex }}{% endcapture %}
<button type="button" class="btn--link js-toggle-submenu mobile-nav__link{% if link.child_active %} mobile-nav__link--active{% endif %}" data-target="{{ child_list_handle }}" data-level="1" aria-expanded="false">
<span class="mobile-nav__label">{{ link.title | escape }}</span>
<div class="mobile-nav__icon">
{% include 'icon-chevron-right' %}
</div>
</button>
<ul class="mobile-nav__dropdown" data-parent="{{ child_list_handle }}" data-level="2">
<li class="visually-hidden" tabindex="-1" data-menu-title="2">
{{- link.title }} {{ 'layout.navigation.menu' | t -}}
</li>

<li class="mobile-nav__item border-bottom">
<div class="mobile-nav__table">
<div class="mobile-nav__table-cell mobile-nav__return">

<button class="btn--link js-toggle-submenu mobile-nav__return-btn" type="button" aria-expanded="true" aria-label="{{ link.title }}"
{% include 'icon-chevron-left' %}
</button>

</div>
<span class="mobile-nav__sublist-link mobile-nav__sublist-header mobile-nav__sublist-header--main-nav-parent">
<span class="mobile-nav__label">{{ link.title | escape }}</span>
</span>
</div>
</li>

{% for childlink in link.links %}
<li class="mobile-nav__item{% unless forloop.last %} border-bottom{% endunless %}">
{% if childlink.links != blank %}
{% capture grandchild_list_handle %}{{ childlink.handle }}-{{ outerLoopIndex }}-{{ forloop.index }}{% endcapture %}
<button type="button" class="btn--link js-toggle-submenu mobile-nav__link mobile-nav__sublist-link" data-target="{{ grandchild_list_handle }}" aria-expanded="false">
<span class="mobile-nav__label">{{ childlink.title | escape }}</span>
<div class="mobile-nav__icon">
{% include 'icon-chevron-right' %}
</div>
</button>
<ul class="mobile-nav__dropdown" data-parent="{{ grandchild_list_handle }}" data-level="3">
<li class="visually-hidden" tabindex="-1" data-menu-title="3">
{{- childlink.title }} {{ 'layout.navigation.menu' | t -}}
</li>
<li class="mobile-nav__item border-bottom">
<div class="mobile-nav__table">
<div class="mobile-nav__table-cell mobile-nav__return">
<button type="button" class="btn--link js-toggle-submenu mobile-nav__return-btn" data-target="{{ child_list_handle }}" aria-expanded="true" aria-label="{{ childlink.title }}">
{% include 'icon-chevron-left' %}
</button>
</div>
<a href="{{ childlink.url }}"
class="mobile-nav__sublist-link mobile-nav__sublist-header"
{% if childlink.current %} aria-current="page"{% endif %}
>
<span class="mobile-nav__label">{{ childlink.title | escape }}</span>
</a>
</div>
</li>
{% for grandchildlink in childlink.links %}
<li class="mobile-nav__item{% unless forloop.last %} border-bottom{% endunless %}">
<a href="{{ grandchildlink.url }}"
class="mobile-nav__sublist-link"
{% if grandchildlink.current %} aria-current="page"{% endif %}
>
<span class="mobile-nav__label">{{ grandchildlink.title | escape }}</span>
</a>
</li>
{% endfor %}
</ul>
{% else %}
<a href="{{ childlink.url }}"
class="mobile-nav__sublist-link"
{% if childlink.current %} aria-current="page"{% endif %}
>
<span class="mobile-nav__label">{{ childlink.title | escape }}</span>
</a>
{% endif %}
</li>
{% endfor %}
</ul>
{% else %}
<a href="{{ link.url }}"
class="mobile-nav__link{% if link.active %} mobile-nav__link--active{% endif %}"
{% if link.current %} aria-current="page"{% endif %}
>
<span class="mobile-nav__label">{{ link.title | escape }}</span>
</a>
{% endif %}
</li>
{% endfor %}
</ul>
</nav>

 

 

0 Likes
Highlighted
Shopify Partner
1685 365 497

Hey @Camille3,

This is the HTML of desktop

<li>
<a href="https://societe-dmd.myshopify.com/#notre-univers" class="site-nav__link site-nav__link--main">
<span class="site-nav__label">Notre univers</span>
</a>

</li>

This is I got for mobile

<main class="main-content js-focus-hidden" id="MainContent" role="main" tabindex="-1">
<!-- BEGIN content_for_index --><div id="shopify-section-hero-1" class="shopify-section index-section index-section--flush"><div class="cov-image">
<img class="img-responsive" src="//cdn.shopify.com/s/files/1/0411/4241/9622/files/DMD_DESTOCKAGE_4.png?v=1592823299" style="width:100%/">
</div>

But the above part is missing in your given code. 

I will check your code further and get back to you.

Thanks!

If helpful then please Like and Accept Solution.
Do you need custom changes on store ? Hire me.
Feel free to Contact me on dmw.webartisan@gmail.com
Follow us on Instagram @dmw.webartisan
0 Likes
Highlighted
New Member
6 0 0

Here is the complete code:

{% if section.settings.message %}
  <style>
    {% if section.settings.logo != blank %}
      .site-header__logo-image {
        max-width: {{ section.settings.logo_max_width | escape }}px;
      }
    {% endif %}
 
    {% if section.settings.align_logo == 'left' %}
      .site-header__logo-image {
        margin: 0;
      }
    {% endif %}
  </style>
{% endif %}
 
{% include 'search-drawer' %}
 
<div data-section-id="{{ section.id }}" data-section-type="header-section" data-header-section>
  {% if section.settings.message %}
    {% if section.settings.home_page_only == false or request.page_type == 'index' %}
      <style>
        .announcement-bar {
          background-color: {{ section.settings.color_bg }};
        }
 
        .announcement-bar__link:hover {
          {% assign brightness = section.settings.color_bg | color_brightness %}
 
          {% if brightness <= 192 %}
            {% assign lightenAmount = 255 | minus: brightness | divided_by: 255 | times: 16 %}
            background-color: {{ section.settings.color_bg | color_lighten: lightenAmount }};
          {% else %}
            {% assign darkenAmount = 255 | divided_by: brightness | times: 8 %}
            background-color: {{ section.settings.color_bg | color_darken: darkenAmount }};
          {% endif %}
        }
 
        .announcement-bar__message {
          color: {{ section.settings.color_text }};
        }
      </style>
 
      <div class="announcement-bar" role="region" aria-label="{{ 'sections.header.announcement_bar_label' | t }}">
        {%- unless section.settings.message_link == blank -%}
          <a href="{{ section.settings.message_link }}" class="announcement-bar__link">
        {%- endunless -%}
            <p class="announcement-bar__message">{{ section.settings.message_text | escape }}</p>
        {%- unless section.settings.message_link == blank -%}
          </a>
        {%- endunless -%}
      </div>
 
    {% endif %}
  {% endif %}
 
  <header class="site-header{% if section.settings.align_logo == 'left' %} border-bottom logo--left{% else %} logo--center{% endif %}" role="banner">
    <div class="grid grid--no-gutters grid--table site-header__mobile-nav">
      {% if section.settings.align_logo == 'center' %}
        {%- assign logo_classes = 'medium-up--one-third medium-up--push-one-third logo-align--center' -%}
      {% else %}
        {%- assign logo_classes = 'medium-up--one-quarter logo-align--left' -%}
      {% endif %}
 
      <div class="grid__item {{ logo_classes }}">
        {% comment %}
          Use the uploaded logo from theme settings if enabled.
          Site name gets precedence with H1 tag on homepage, div on other pages.
        {% endcomment %}
        {% if request.page_type == 'index' %}
          <h1 class="h2 site-header__logo">
        {% else %}
          <div class="h2 site-header__logo">
        {% endif %}
          {% if section.settings.logo %}
            {%- assign img_url = section.settings.logo | img_url: '1x1' | replace: '_1x1.', '_{width}x.' -%}
            <a href="{{ routes.root_url }}" class="site-header__logo-image{% if section.settings.align_logo == 'center' %} site-header__logo-image--centered{% endif %}">
              {% capture logo_alt %}{{ section.settings.logo.alt | default: shop.name }}{% endcapture %}
              <img class="lazyload js"
                   src="{{ section.settings.logo | img_url: '300x300' }}"
                   data-src="{{ img_url }}"
                   data-widths="[180, 360, 540, 720, 900, 1080, 1296, 1512, 1728, 2048]"
                   data-aspectratio="{{ section.settings.logo.aspect_ratio }}"
                   data-sizes="auto"
                   alt="{{ logo_alt | escape }}"
                   style="max-width: {{ section.settings.logo_max_width }}px">
              <noscript>
                {% capture image_size %}{{ section.settings.logo_max_width | escape }}x{% endcapture %}
                <img src="{{ section.settings.logo | img_url: image_size }}"
                     srcset="{{ section.settings.logo | img_url: image_size }} 1x, {{ section.settings.logo | img_url: image_size, scale: 2 }} 2x"
                     alt="{{ section.settings.logo.alt | default: shop.name }}"
                     style="max-width: {{ section.settings.logo_max_width }}px;">
              </noscript>
            </a>
          {% else %}
            <a class="site-header__logo-link" href="{{ routes.root_url }}">{{ shop.name }}</a>
          {% endif %}
        {% if request.page_type == 'index' %}
          </h1>
        {% else %}
          </div>
        {% endif %}
      </div>
 
      {% if section.settings.align_logo == 'left' %}
      
      
        <nav class="grid__item medium-up--one-half small--hide" id="AccessibleNav" role="navigation">
          
        {% include 'site-nav', linklist: section.settings.main_linklist %}
        </nav>
      {% endif %}
 
 
      <div class="grid__item {% if section.settings.align_logo == 'left' %}medium-up--one-quarter{% else %}medium-up--one-third medium-up--push-one-third{% endif %} text-right site-header__icons{% if shop.customer_accounts_enabled %} site-header__icons--plus{% endif %}">
        <div class="site-header__icons-wrapper">
 
          {% if shop.customer_accounts_enabled %}
            {% if customer %}
              <a href="{{ routes.account_url }}" class="site-header__icon site-header__account">
                {% include 'icon-login' %}
                <span class="icon__fallback-text">{{ 'layout.customer.account' | t }}</span>
              </a>
             <a href="{{ routes.cart_url }}" class="site-header__icon site-header__cart">
            {% include 'icon-cart' %}
            {% endif %}
          {% endif %}
 
          {% if shop.customer_accounts_enabled %}
            {% if customer %}
            <span class="icon__fallback-text">{{ 'layout.cart.title' | t }}</span>
            <div id="CartCount" class="site-header__cart-count{% if cart.item_count == 0 %} hide{% endif %}" data-cart-count-bubble>
              <span data-cart-count>{{ cart.item_count }}</span>
              <span class="icon__fallback-text medium-up--hide">{{ 'layout.cart.items_count' | t: count: cart.item_count }}</span>
            </div>
          </a>
             {% endif %}
          {% endif %}
 
          {% unless linklists[section.settings.main_linklist] == blank %}
          <a href="/collections/tous-les-produits">
      <img class= "item-espace-pro espace-pro-icon" src="//cdn.shopify.com/s/files/1/0411/4241/9622/files/bag.png?v=1593006546" alt="DMD Products" >
          </a>
      <button type="button" class="btn--link site-header__icon site-header__menu js-mobile-nav-toggle mobile-nav--open" aria-controls="MobileNav"  aria-expanded="false" aria-label="{{ 'layout.navigation.menu' | t }}">
              {% include 'icon-hamburger' %}
              {% include 'icon-close' %}
            </button>
           {% endunless %}
          </div>
           
        </div>
 
      </div>
    </div>
 
    <nav class="mobile-nav-wrapper medium-up--hide" role="navigation">
      <ul id="MobileNav" class="mobile-nav">
        {% for link in linklists[section.settings.main_linklist].links %}
          {%- assign outerLoopIndex = forloop.index -%}
 
          <li class="mobile-nav__item{% unless forloop.last %} border-bottom{% endunless %}">
            {% if link.links != blank %}
              {% capture child_list_handle %}{{ link.handle }}-{{ outerLoopIndex }}{% endcapture %}
              <button type="button" class="btn--link js-toggle-submenu mobile-nav__link{% if link.child_active %} mobile-nav__link--active{% endif %}" data-target="{{ child_list_handle }}" data-level="1" aria-expanded="false">
                <span class="mobile-nav__label">{{ link.title | escape }}</span>
                <div class="mobile-nav__icon">
                  {% include 'icon-chevron-right' %}
                </div>
              </button>
              <ul class="mobile-nav__dropdown" data-parent="{{ child_list_handle }}" data-level="2">
                <li class="visually-hidden" tabindex="-1" data-menu-title="2">
                  {{- link.title }} {{ 'layout.navigation.menu' | t -}}
                </li>
            
                <li class="mobile-nav__item border-bottom">
                  <div class="mobile-nav__table">
                    <div class="mobile-nav__table-cell mobile-nav__return">
                   
                      <button class="btn--link js-toggle-submenu mobile-nav__return-btn" type="button" aria-expanded="true" aria-label="{{ link.title }}"
                        {% include 'icon-chevron-left' %}
                      </button>
                      
                    </div>
                    <span class="mobile-nav__sublist-link mobile-nav__sublist-header mobile-nav__sublist-header--main-nav-parent">
                      <span class="mobile-nav__label">{{ link.title | escape }}</span>
                    </span>
                  </div>
                </li>
 
                {% for childlink in link.links %}
                  <li class="mobile-nav__item{% unless forloop.last %} border-bottom{% endunless %}">
                    {% if childlink.links != blank %}
                      {% capture grandchild_list_handle %}{{ childlink.handle }}-{{ outerLoopIndex }}-{{ forloop.index }}{% endcapture %}
                      <button type="button" class="btn--link js-toggle-submenu mobile-nav__link mobile-nav__sublist-link" data-target="{{ grandchild_list_handle }}" aria-expanded="false">
                        <span class="mobile-nav__label">{{ childlink.title | escape }}</span>
                        <div class="mobile-nav__icon">
                          {% include 'icon-chevron-right' %}
                        </div>
                      </button>
                      <ul class="mobile-nav__dropdown" data-parent="{{ grandchild_list_handle }}" data-level="3">
                        <li class="visually-hidden" tabindex="-1" data-menu-title="3">
                          {{- childlink.title }} {{ 'layout.navigation.menu' | t -}}
                        </li>
                        <li class="mobile-nav__item border-bottom">
                          <div class="mobile-nav__table">
                            <div class="mobile-nav__table-cell mobile-nav__return">
                              <button type="button" class="btn--link js-toggle-submenu mobile-nav__return-btn" data-target="{{ child_list_handle }}" aria-expanded="true" aria-label="{{ childlink.title }}">
                                {% include 'icon-chevron-left' %}
                              </button>
                            </div>
                            <a href="{{ childlink.url }}"
                              class="mobile-nav__sublist-link mobile-nav__sublist-header"
                              {% if childlink.current %} aria-current="page"{% endif %}
                            >
                              <span class="mobile-nav__label">{{ childlink.title | escape }}</span>
                            </a>
                          </div>
                        </li>
                        {% for grandchildlink in childlink.links %}
                          <li class="mobile-nav__item{% unless forloop.last %} border-bottom{% endunless %}">
                            <a href="{{ grandchildlink.url }}"
                              class="mobile-nav__sublist-link"
                              {% if grandchildlink.current %} aria-current="page"{% endif %}
                            >
                              <span class="mobile-nav__label">{{ grandchildlink.title | escape }}</span>
                            </a>
                          </li>
                        {% endfor %}
                      </ul>
                    {% else %}
                      <a href="{{ childlink.url }}"
                        class="mobile-nav__sublist-link"
                        {% if childlink.current %} aria-current="page"{% endif %}
                      >
                        <span class="mobile-nav__label">{{ childlink.title | escape }}</span>
                      </a>
                    {% endif %}
                  </li>
                {% endfor %}
              </ul>
            {% else %}
              <a href="{{ link.url }}"
                class="mobile-nav__link{% if link.active %} mobile-nav__link--active{% endif %}"
                {% if link.current %} aria-current="page"{% endif %}
              >
                <span class="mobile-nav__label">{{ link.title | escape }}</span>
              </a>
            {% endif %}
          </li>
        {% endfor %}
      </ul>
    </nav>
  </header>
 
  {% if section.settings.align_logo == 'center' %}
  <nav class="small--hide border-bottom" id="AccessibleNav" role="navigation">
    {% include 'site-nav', linklist: section.settings.main_linklist, wrapper_class: 'site-nav--centered' %}
  </nav>
  {% endif %}
</div>
 
 
 
<script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "Organization",
  "name": {{ shop.name | json }},
  {% if section.settings.logo %}
    {% assign image_size = section.settings.logo.width | append:'x' %}
    "logo": {{ section.settings.logo | img_url: image_size | prepend: "https:" | json }},
  {% endif %}
  "sameAs": [
    {{ settings.social_twitter_link | json }},
    {{ settings.social_facebook_link | json }},
    {{ settings.social_pinterest_link | json }},
    {{ settings.social_instagram_link | json }},
    {{ settings.social_tumblr_link | json }},
    {{ settings.social_snapchat_link | json }},
    {{ settings.social_youtube_link | json }},
    {{ settings.social_vimeo_link | json }}
  ],
  "url": {{ shop.url | append: page.url | json }}
}
</script>
 
{% if request.page_type == 'index' %}
  {% assign potential_action_target = shop.url | append: routes.search_url | append: "?q={search_term_string}" %}
  <script type="application/ld+json">
    {
      "@context": "http://schema.org",
      "@type": "WebSite",
      "name": {{ shop.name | json }},
      "potentialAction": {
        "@type": "SearchAction",
        "target": {{ potential_action_target | json }},
        "query-input": "required name=search_term_string"
      },
      "url": {{ shop.url | append: page.url | json }}
    }
  </script>
{% endif %}
0 Likes
Highlighted
Shopify Partner
1685 365 497

Hey @Camille3,

It's not the code problem. It seems the problem of padding and margins is given.

I will check further and get back to you.

Thanks!

If helpful then please Like and Accept Solution.
Do you need custom changes on store ? Hire me.
Feel free to Contact me on dmw.webartisan@gmail.com
Follow us on Instagram @dmw.webartisan
0 Likes