3
respostas

Scroll lateral não funciona

Simplesmente não aparece o scroll lateral

(`)@media(min-width: 1440px) {
    .menu__container {
        position: fixed;
        left: 0;
        top: 0;
        bottom: unset;
        height: 100%;
        width: 239px;
        overflow: scroll;

Garanta sua matrícula hoje e ganhe + 2 meses grátis

Continue sua jornada tech com ainda mais tempo para aprender e evoluir

Quero aproveitar agora
3 respostas

Oi, Estudante! Como vai?

O que oparece aqui é que o scroll lateral não aparece porque:

  • O caractere ` antes de @media está quebrando o CSS.
  • Para rolar na horizontal, você precisa de overflow-x e itens que não encolham.

Exemplo corrigindo sua media query e ativando rolagem horizontal:


@media (min-width: 1440px) {
  .menu__container {
    position: fixed;
    left: 0;
    top: 0;
    height: 100%;
    width: 239px;

    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;   /* scroll horizontal */
    overflow-y: hidden; /* esconde scroll vertical */
    white-space: nowrap;
  }

  .menu__item {
    flex: 0 0 auto;     /* impede encolhimento */
    min-width: 160px;   /* força overflow no eixo X */
  }
}

Dica rápida:
Se você queria rolagem vertical, troque para overflow-y: auto e use overflow-x: hidden.

Espero ter ajudado. Conte com o apoio do Fórum na sua jornada. Fico à disposição.

Abraços e bons estudos!

Caso este post tenha lhe ajudado, por favor, marcar como solucionado

Segue meu código:

/* CABEÇALHO */

.cabecalho__container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
}

.cabecalho__pesquisar__item {
    display: none;
}

/* MENU */

.menu__container {
    position: fixed;
    bottom: 0%;
    height: 74px;
    width: 100%;
}

.menu__lista {
    display: flex;
    justify-content: space-around;
    height: 100%;
}

.menu__lista li {
    align-items: center;
}

.menu__itens {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.menu__lista:nth-child(2),
.menu__lista:nth-child(3),
.menu__lista:nth-child(4) {
    display: none;
}



   /* SUPERIOR SEÇÃO */

.superior__secao__container {
    display: flex;
    align-items: center;
    white-space: nowrap;
    overflow-x: auto;
    gap: 15px;
    width: 100%;
}

/* VÍDEOS */
.videos__container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px
    justify-items: center;
}

.videos__item {
    heigt 303px;
    width: 280px;
    max-width: 500px;
    flex-grow: 1;
}

/* RODAPÉ */

.rodape__container {
     display: flex;
    flex-direction: column; 
    flex-wrap: wrap;
   
}

@media (min-width: 834px) {

   /* CABEÇALHO  */
    
    .cabecalho__pesquisar__item {
        display: block;
    }

   /* RODAPÉ  */
    
    .rodape__container {
        justify-content: space-between;
    }
}
@media(min-width: 1440px) {
    .menu__container {
        position: fixed;
        left: 0;
        top: 0;
        bottom: unset;
        height: 100%;
        width: 239px;
        overflow: scroll;
    }
    .menu__lista:nth-child(2),
    .menu__lista:nth-child(3),
    .menu__lista:nth-child(4) {
        display: flex;
    }
    
    .menu__lista {
        height: auto;
        padding: 20px 17px 20px 15px;
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        gap: 15px;
    }

    .menu__itens {
        flex-direction: row;
        gap: 15px;
        line-height: 2;
        align-items: center;
    }

    .menu__lista:nth-child(3) {
        flex-direction: column-reverse;
    }

    .jogos {
        order: 3;
    }

    .filmes {
        order: 2;
    }

    .premium {
        order: 1;
    }

    .maispagina {
        order: 4;
    }
}

Oi, Estudante!

Sobre sua última dúvida: o scroll “lateral” não aparece porque, no layout de 1440px, seu menu vira uma coluna fixa de 239px. Ou seja, o que você precisa é rolagem vertical no menu (não horizontal). Além disso, há erros de sintaxe que quebram o CSS e impedem o comportamento esperado.

Resolva fazendo o seguinte:

  1. Corrija a sintaxe:

    • gap: 10px estava sem ponto e vírgula.
    • heigt precisa ser height.
    • justify-items não funciona em flex container, use justify-content ou align-items.
    • Retire bottom: unset; pois é desnecessário.
  2. Ative a rolagem vertical no menu fixo:

    • Use overflow-y: auto; e esconda o eixo X com overflow-x: hidden;.
    • Ajuste a altura com base no cabeçalho fixo, senão o menu ficará escondido.

Fica assim:


/* CABEÇALHO */
.cabecalho__container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px; /* altura do header */
  z-index: 10;
}

.cabecalho__pesquisar__item {
  display: none;
}

/* MENU (mobile) */
.menu__container {
  position: fixed;
  bottom: 0;
  height: 74px;
  width: 100%;
}

.menu__lista {
  display: flex;
  justify-content: space-around;
  height: 100%;
}

.menu__lista li {
  display: flex;
  align-items: center;
}

.menu__itens {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.menu__lista:nth-child(2),
.menu__lista:nth-child(3),
.menu__lista:nth-child(4) {
  display: none;
}

/* SUPERIOR SEÇÃO */
.superior__secao__container {
  display: flex;
  align-items: center;
  white-space: nowrap;
  overflow-x: auto;
  gap: 15px;
  width: 100%;
}

/* VÍDEOS */
.videos__container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;              /* corrigido */
  justify-content: center;
}

.videos__item {
  height: 303px;          /* corrigido */
  width: 280px;
  max-width: 500px;
  flex-grow: 1;
}

/* RODAPÉ */
.rodape__container {
  display: flex;
  flex-direction: column; 
  flex-wrap: wrap;
}

@media (min-width: 834px) {
  .cabecalho__pesquisar__item {
    display: block;
  }
  .rodape__container {
    justify-content: space-between;
  }
}

@media (min-width: 1440px) {
  .menu__container {
    position: fixed;
    left: 0;
    top: 56px;                  /* deixa espaço para o cabeçalho */
    height: calc(100vh - 56px); /* ocupa o restante da tela */
    width: 239px;
    overflow-y: auto;           /* rolagem vertical */
    overflow-x: hidden;
  }

  .menu__lista:nth-child(2),
  .menu__lista:nth-child(3),
  .menu__lista:nth-child(4) {
    display: flex;
  }

  .menu__lista {
    height: auto;
    padding: 20px 17px 20px 15px;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 15px;
  }

  .menu__itens {
    flex-direction: row;
    gap: 15px;
    line-height: 2;
    align-items: center;
  }

  .menu__lista:nth-child(3) {
    flex-direction: column-reverse;
  }

  .jogos   { order: 3; }
  .filmes  { order: 2; }
  .premium { order: 1; }
  .maispagina { order: 4; }
}

Pontos importantes:

  • Scroll vertical: use overflow-y: auto quando o conteúdo é longo dentro da coluna.
  • Scroll horizontal: só use se os itens realmente estiverem lado a lado (flex-direction: row; flex-wrap: nowrap;).

Fico à disposição. Abraços e bons estudos!

Caso este post tenha lhe ajudado, por favor, marcar como solucionado