0
How to set a menu so that clicking on any item directs the user to the exact starting point of Section related to the clicked item?
The problem is that when clicked directs to the beginning of the paragraph tag instead of the beginning of the Section as defined in the menu.
I’m using a Sticky menu, describe a part of the code as an example
html code:
...
<div id="navbar">
<a href="#start">Inicio</a>
<a href="#nosotros">Nosotros</a>
<a href="#contact">Contacto</a>
</div>
<script src="js/navbar_javascript.js"></script>
</div>
</header>
For all are defined a Section...
<section id="nosotros">
<div class="container-fluid">
<div class="quienes_somos">
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-12 ">
<div class="foto_nosotros">
<img src="" alt="" width="">
</div>>
</div>
<div class="col-lg-6 col-md-6 col-sm-12">
<h3 class="title_que_hacemos">Sobre Nosotros...</h3>
<p class="text_que_hacemos"> ... </p>
</div>
</div>
</div>
</div>
</section>
In css I set top and bottom margins for Section:
#nosotros {
margin-top: 10vh;
margin-bottom: 10vh;
}
I hope you have expressed yourself well. I have tried several options.. I hope someone can help me! :)
I didn’t understand the problem. By clicking on
<a href="#nosotros">Nosotros</a>
will go to the beginning of<section id="nosotros">
.– Sam
Are you using Bootstrap? Which version? You mean when you go to Section a piece of it gets underneath the Navbar, covering part of the content is this?
– hugocsl
Yes, Bootstrap 04. Exactly that hugosl! The 10vh margin and the title that are inside the Section are outside the visualization area. I need to scroll up to see.
– Rose