👋🏾 The dropdown section of the nav still not working ... any help on this / comments on how better I would have handled the challenge will be much appreciated.
Alex Martos P.
@AlexMartosPAll comments
- @LeskimSubmitted about 2 years ago@AlexMartosPPosted about 2 years ago
Great work!
First of all, you should have href="#", so that the website don't refresh.
There are som ways you can fix the navbar, you could add a state called "isActive" and when you click a link the state changes with the clicked link for example "Company".
Then you can do this:
<ul classNamse={`nav-list_secondary ${isActive === "Features" ? "open" : ""}`}
Another way you can do this, is by creating two different states, one for each nav link that have a drop down and then check like above but only checking if "isActive" is true or false.
If you want to use vanilla JS like as you do, you can do that to. I changed your code so that it should work (not tested):
const showDropDown = (e) => { e.target.nextElementSibling.classList.toggle("open"); };
Here is my solution if you want to take a look: https://www.frontendmentor.io/solutions/intro-section-with-dropdown-navigation-made-with-reactjs-AUet3fha6z
Marked as helpful0 - @Clement1kalu-okerekeSubmitted about 2 years ago
Can anyone help with the hover and responsiveness of the site
@AlexMartosPPosted about 2 years agoGreat work man!!
I see you use semantic HTML and that is very good.
To change style on hover state you add :hover to the selector you want to change when hovering it.
For example on your "Learn more button" you would do like this:
main__learn:hover {}
.I think you have done a good job on the responsive part, what I would do is increase the width when the image goes to the top. Otherwise the text area will become very small :)
1 - @Arthur-GnzSubmitted about 2 years ago
Could you give me feedback? (Anything is accepted)
@AlexMartosPPosted about 2 years agoGood job! I see that you tried using the font from the design. To use it you have to.
- Get the Google fonts via the link here: https://fonts.google.com/specimen/Outfit?query=outfit
- Get the font family by
font-family: 'Outfit', sans-serif
(sans-serif is the fallback)
Other thing you can think about is using padding/margin instead of <br> and "font-weight" instead of <strong>
But again, good job!
Marked as helpful0