Only one button of my nav bar is working. What is incorrect when it comes to the nav bar and nav links in my code?

I will try to explain it over my point of view, I was looking at your code, and I saw that in nav, the Prices, has an id that when it get’s clicked it takes you down to that section because of the" section id=“prices” “. I tried to search if the others id’s: “#Learn-more-about-our-flowers” and “#methods-of-payment” were redirecting to another section, i didn’t find any other id(”#Learn-more-about-our-flowers" and “#methods-of-payment”) that redirect to another section, maybe this is the problem,
I want to say too that your css has some errors, all are in the media query 100px. One of the errors that I found is that you didn’t specify the media quey right,
Expected:
@media (max-width: 100px){}
Your code:
@media {max-width: 100px;}
another one is {text-align:center; margin:px;}, you need to specify to who is applied

1 Like

I’m aware of the lacking of ids, however I have no idea of where I should place them.

you got two options:
1- make another section like you did with “prices”
2- make another html file and link to it:

<li><a class="nav-link" href="./(path to the html)">Learn more about our flowers</a></li>

and it will redirect to the other page, remember to have them in the same folder

1 Like

In Codepen I guess you can’t link another html, so your best option will be to use
<section></section>

1 Like

I sectioned two parts of my code and it has not work.

because instead of:
<div class="flex-container" id="leanr more about the flowers">
should be:
<div class="flex-container" id="Learn-more-about-our-flowers">

remember to put the same as the id

Unfortunately, it is still not working.

i tried your page, and it works, it goes to the section
what is the problem? i don’t get it?

1 Like

I refreshed the page and it works perfectly now. Thank you so much. My code is a bit disorganised, and I should have been more attentive whilst building each part of it.

I have send a lot of messages that i arrived the limit, So happy that it works, if you need something more we are here to help you :sunglasses:

1 Like

@rafaelleduarte1993, please, please, please use the W3C validator.

And please review this for an understanding of the HTML boilerplate tags. (I’ve provided you with this in another topic)
Your head element is incorrectly placed.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.