Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

145
Visualizações
how to show contents of section while not having it overflow into another section React.js

I have a section called Timeline that is overflowing into another section called Contact in my React website.

enter image description here

What can I do so that all the contents of Timeline show but also do not overflow into another section?

Edit: The lightblue portion is where the Contact section starts

Edit:

import React from 'react'
import './app.scss';
import Navbar from "./components/navbar/Navbar"
import Intro from "./components/intro/Intro"
import Menu from "./components/menu/Menu"
import Timeline from './components/timeline/Timeline';
import Contact from "./components/contact/Contact"
import { useState } from "react"
App.jsx
function App() {
  const [menuOpen, setMenuOpen] = useState(false)
  return (
    <div className="app">
      <Navbar menuOpen={menuOpen} setMenuOpen={setMenuOpen}/>
      <Menu menuOpen={menuOpen} setMenuOpen={setMenuOpen}/>
      <div className="sections">
        <Intro/>
        <Timeline/>
        <Contact/>
      </div>
    </div>
  );
}

app.scss

.app {
    height: 100vh;

    .sections {
        width: 100%;
        height: calc(100vh - 70px);
        // background-color: #1F1D36;
        position: relative;
        top: 70px;
        scroll-behavior: smooth;
        display: flex;
        scroll-snap-type: y mandatory;
        scrollbar-width: none; // for firefox
        &::-webkit-scrollbar{
            display: none;
        }

        > * {
            width: 100vw;
            height: calc(100vh - 70px);
            scroll-snap-align: start;
        }
    }
}
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Add max-height to .sections containing timeline and add overflow-y:auto.

This stops the section from expanding extra and makes the content scroll.

Here is a code that you can refer.

*{
  padding:0;
  margin:0;
  box-sizing: border-box;
}

.child{
  height: calc(100vh - 70px);
}

.child:first-child{
  background: yellow;
  max-height: calc(100vh - 70px);
  overflow-y:auto;
}

.child:last-child{
  background: lightblue;
}

.large{
  height: 900px;
  background: white;
  margin: 2rem;
}
<html>

<body>
  <div id="parent">
  <div class="child">
    <div class="large"></div>
  </div>
  <div class="child"></div>
</div>
</body>
</html>

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda