D
D
Dovitwtu2018-02-19 18:01:33
css
Dovitwtu, 2018-02-19 18:01:33

Why display: none doesn't work?

I want to make a menu - a hamburger in the mobile version. But to be visible only in the mobile version. And in full screen mode, the usual menu. I can see both in the mobile version and in full screen mode, display: none does not work. What can be done?
There is html code:

<div class="col-xl-auto">
  <button class="top-nav_btn">
    <i class="icon-menu"></i>
  </button>
    <ul class="top-nav_menu">
      <li><a href="#">Главная</a></li>
      <li><a href="#">О компании</a></li>
      <li><a href="#">наши услуги</a></li>
      <li><a href="#">Структура</a></li>
      <li><a href="#">инвесторам</a></li>
      <li><a href="#">контакты</a></li>
    </ul>
  </div>

Sass:
.top-nav
    background-color: $white
    padding: 15px
    position: relative
    &_btn  
        display: none 
        width: 30px
        height: 30px
        background-color: transparent
        border: none
        font-size: 18px  
        position: absolute
        right: 15px
        top: -50px

Here is media.sass:
@media (max-width: 480px)
  .top-nav
    &_btn
      display: block

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vova, 2018-02-19
@vova87

Classes are different

D
Dovitwtu, 2018-02-20
@dmd7

Everything, the issue is resolved. Just overridden by another selector

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question