1
Good morning, I am developing a site, and at first everything is working, but Scrollspy (Bootstrap 3.3) is not working, I followed several internet tutorials on how to apply it in a Website but I did not succeed even following them correctly. Here’s an excerpt from my code.
html, body {
font-family: 'Montserrat', sans-serif;
width:100%;
height:100%;
padding:0px;
margin:0px;
text-shadow:none;
background:#FFF !important;
position: relative;
}
.links-navbar{
text-align: center;
margin: 10px;
}
.links-navbar a {
padding: 25px 36px;
font-size: 18px;
font-weight: 600;
color: #FFFFFF;
text-transform: uppercase;
}
.navbar .links-navbar a:hover,
.navbar .links-navbar>.active>a,
.navbar .links-navbar a:focus {
text-decoration: none;
z-index: 20;
color: var(--hoverLink);
background-color: var(--hoverFundo);
}
<header>
<nav id="navbar" class="navbar hidden-xs hidden-sm" style="background-color: transparent;">
<div class="container">
<div id="logos" class="col-md-12">
<div class="col-md-2" style="margin-top:35px;">
<a href="https://dalposso.com.br" target="_blank">
<img src="images/dalposso-logo.png" class="img-responsive">
</a>
</div>
<div class="col-md-2"></div>
<div class="col-md-4" style="margin-top:35px;">
<a href="index.php">
<img src="images/murano-logo.png" style="width: 100%;">
</a>
</div>
<div class="col-md-4 text-center" style="padding-top: 90px;">
<a href="https://dalposso.com.br" class="link-dalposso">
Voltar para o site
</a>
</div>
</div>
</div>
<div id="navegacao" class="col-md-12" style="margin-top:50px; padding: 0; z-index: 20;">
<div class="links-navbar nav">
<a href="#emprendimento">o emprendimento</a>
<a href="#areas">áreas comuns</a>
<a href="#garagens">garagens</a>
<a href="#apartamentos">apartamentos</a>
<a href="#localizacao">localizacao</a>
<a href="#contato">contato</a>
</div>
</div>
</nav>
</header>
He is in position relative no body, I followed all the instructions you mentioned as the bootstrap Nav but I was unsuccessful. Was something missing? Just like I tried to trade that div of . links-navbar for a <ul>, with each link being a <li>.
– Alex Borgmann
@aleque_b face re-edits your question and puts the full code of your page, the same way I did in my answer, puts everything you have between the HTML tags and your CSS as well. 'Cause if you look at the example you’ll see that it works, then it’s probably something you did, or failed to do in the structure that’s bugging Spy
– hugocsl
Yes I edited and HTML is as posted now, I did not post the whole code because it is merging HTML, CSS and PHP. But so, all anchors are configured, just like Divs with Id. There’s nothing wrong with it. But still not working.
– Alex Borgmann
@aleque_b Face your Navbar still remains completely different from the standard Bootstrap model.... Look at my response as is mine
<nav></nav>
You’re building your Navbar inside that div<div class="links-navbar nav">
This is totally different from what the documentation says.... Guy picks up the model I posted and "rebuilt" your page inside it, I think it’s an option for you since it’s not rolling with your code.– hugocsl
I redid the heading of 0 and it seems that now it worked. Sorry for the delay in answering, I had to reform all the CSS to be stylized as it was in the previous header. Thank you very much!
– Alex Borgmann
@aleque_b quiet young these components are boring to even fiddle, have to follow the documentation to work right, any different order in html tags, or a css class unless the component already stops working, but I’m glad it worked out, Good luck there with the project and... "read documentation" rss. [] s
– hugocsl