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

127
Visualizações
How can I create a fixed sidebar navigation that highlights the currently viewed section of the page?

This seems like it should be simple but I'm having a hard time finding an example of how to implement this. I cannot figure out how to get the sidebar links to highlight when I scroll to the respective id that the link points to on the page. Here is an example of this on the Microsoft Docs site (the righthand sidebar):

https://docs.microsoft.com/en-us/aspnet/core/blazor/?view=aspnetcore-6.0

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You need to add a position sticky to your sidebar with the specific top property. for more information, you can read this article. How to make a sticky sidebar with two lines of CSS

.app {
  display: flex;
  justify-content: space-between;
  min-height: 100vh;
}

aside {
  width: 33%;
  border: 1px solid lightgray;
  position: sticky;
  top: 0;
  height: 100vh;
}

main {
  width: 66%;
}

main div {
  min-height: 300px;
  margin: 10px;
  width: 100%;
  border: 1px solid red;
}
<div class="app">
  <aside>Sticky Sidebar</aside>
  <main>
    <div>section</div>
    <div>section</div>
    <div>section</div>
    <div>section</div>
    <div>section</div>
    <div>section</div>
    <div>section</div>
    <div>section</div>
  </main>
</div>

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