When the width of my navigation bar reaches a maximum of 560px, a hamburger menu appears for mobile devices. I want to implement a functionality where clicking on a navigation item (e.g., About) will close the nav-container instead of making it disappear completely. Is there a way to achieve this? Also, I only want this behavior to take effect at a maximum width of 560px.
/*--------------------------------
FONTS
---------------------------------*/
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:ital,wght@0,400;0,700;1,400;1,700&display=swap');
/*--------------------------------
RESET
---------------------------------*/
* {
font-family: 'Noto Sans', sans-serif;
}
html, body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
scroll-behavior: smooth;
}
/*--------------------------------
GLOBAL
---------------------------------*/
p {
color: #767676;
line-height: 23px;
font-family: 'Nunito', sans-serif;
}
.btn {
color: #fff;
padding: 30px 60px;
font-size: 20px;
letter-spacing: 3px;
font-weight: 500;
background-color: #daa37f;
border-radius: 20px;
text-align: center;
text-transform: uppercase;
...